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

Refactor any #104

Merged
merged 1 commit into from
May 9, 2020
Merged

Refactor any #104

merged 1 commit into from
May 9, 2020

Conversation

ryanve
Copy link
Owner

@ryanve ryanve commented May 9, 2020

Handle ssv.any with code reuse at some speed cost but with 32B overall code savings. A even terser way to do this would be !!and(set, search) but that's slower because it does much more than what any needs. I sampled 3 ways in node 12 using lap

ssv.any("mark tom travis", "tom scott travis")
  • 2200 ops/ms for original loop that returns true as soon as it sees "tom"
  • 1310 ops/ms for count way I chose
  • 452 ops/ms for and way

@ryanve ryanve merged commit 61a14f7 into master May 9, 2020
@ryanve ryanve deleted the any branch May 9, 2020 01:19
@ryanve ryanve mentioned this pull request May 9, 2020
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

Successfully merging this pull request may close these issues.

1 participant