Pidgin icon indicating copy to clipboard operation
Pidgin copied to clipboard

SearchValues<T> in .NET 8

Open znakeeye opened this issue 1 year ago • 2 comments

Thanks for your awesome library!

Not sure if the SearchValues<T> is applicable for Pidgin, but it certainly sounds like a good fit.

Also, see this this great blog post where the author tries out this new feature.

znakeeye avatar May 03 '24 22:05 znakeeye

I'll need to think about this. It seems SearchValues is designed with string- or array-searching in mind. In general we don't have the full text available when parsing (it's streamed) so it may not be a good fit. Besides, recursive descent parsing is generally about matching the current token, not searching for a specific substring.

However I can envision a use case like "search forward in the stream using SearchValues and begin parsing from there". At present you need to wind forward token by token to find a match so perhaps there's hay to be made by vectorising that search. The partial data issue is a problem there though (when doing substring matching and not single-token matching).

benjamin-hodgson avatar May 08 '24 19:05 benjamin-hodgson

Makes sense. I mostly thought of AnyCharExcept() when I stumbled upon that SearchValues feature.

znakeeye avatar May 08 '24 21:05 znakeeye