Skip to content

Consider adding a SearchValues<string> specialization for two or three input strings #91795

@stephentoub

Description

@stephentoub

Rather than doing the full-blown teddy implementation, it could potentially have a significantly tighter inner loop by doing what we do today for IndexOf("...", OrdinalIgnoreCase), e.g. creating a vector for two characters in each string and comparing those against the input at appropriate offsets. This will require prototyping and measurements to see if it's actually a win; it's an idea @MihaZupan and I discussed as a way to possibly mitigate overheads when searching for strings that have starting characters that don't match very frequently, in which case IndexOfAny(startingCharacters) does fairly well.

Metadata

Metadata

Labels

area-System.Runtimein-prThere is an active PR which will close this issue when it is mergedtenet-performancePerformance related issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions