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

Fast string search? #39

Closed
ArtemGr opened this issue Jul 17, 2015 · 3 comments
Closed

Fast string search? #39

ArtemGr opened this issue Jul 17, 2015 · 3 comments

Comments

@ArtemGr
Copy link

ArtemGr commented Jul 17, 2015

I wonder if you use or could use something like https://github.com/shepmaster/jetscii for some of the matching primitives?

@Marwes
Copy link
Owner

Marwes commented Jul 18, 2015

I don't use anything like that currently, it seems like it reads 16 bytes at a time which is not really compatible with the Stream interface I use currently which just takes one token at a time instead of looking at a whole range. I will keep the ability to use custom searchers such as jetscii when working on ranged streams (for lack of a better name).

I have some WIP at https://github.com/Marwes/combine/tree/range_stream though I am not really happy with that interface right now.

@Marwes
Copy link
Owner

Marwes commented Jul 18, 2015

That being said, since that search is specialized on &str you could just circumvent the Stream trait and write your own parser which is specialized only on &str which calls the find method and if it succeeds just skips ahead to index that is returned, you just need to remember to update the position as well.

@ArtemGr
Copy link
Author

ArtemGr commented Jul 18, 2015

which is not really compatible with the Stream interface I use currently which just takes one token at a time

I suspected as much. Most parsers just take one token at a time.
Thanks for answering.

@ArtemGr ArtemGr closed this as completed Jul 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants