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

Regex seem to be almost as performant #25

Closed
mustafa0x opened this issue Mar 27, 2021 · 0 comments
Closed

Regex seem to be almost as performant #25

mustafa0x opened this issue Mar 27, 2021 · 0 comments

Comments

@mustafa0x
Copy link

mustafa0x commented Mar 27, 2021

From my tests on a ~400 kb dataset, the the mraleph's approach was barely faster than regexps, not several orders of magnitude as the graph in the README shows.

As for the jsperf test results, then that might be due to toReg and escapeRegExp. That should be done once, not on every iteration.

Edit: very odd. When the needle is english the regex doesn't perform well. My initial tests were with an Arabic needle.

Edit two: so regexes turned out to be quite close in performance, but it depends on the needle and query.

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

1 participant