Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SearchValues<T> in .NET 8 #156

Open
znakeeye opened this issue May 3, 2024 · 2 comments
Open

SearchValues<T> in .NET 8 #156

znakeeye opened this issue May 3, 2024 · 2 comments

Comments

@znakeeye
Copy link

znakeeye commented May 3, 2024

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.

@benjamin-hodgson
Copy link
Owner

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).

@znakeeye
Copy link
Author

znakeeye commented May 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants