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

Optimize and #103

Merged
merged 1 commit into from
May 9, 2020
Merged

Optimize and #103

merged 1 commit into from
May 9, 2020

Conversation

ryanve
Copy link
Owner

@ryanve ryanve commented May 9, 2020

Simplify operation needed for ssv.and while still reusing existing code. I chose the middle way after sampling 3 ways in node 12 with lap

366 ops/ms

// original way
return not(
  or(left, left),
  xor(left, right))

458 ops/ms

// faster and terser
return not(
  yolo(left),
  xor(left, right))

545 ops/ms

// fastest but trippy
return not(
  yolo(left),
  not(left, right) + space +
  not(right, left))

sample operation

ssv.and("mark tom travis", "tom scott travis")

@ryanve ryanve merged commit 63ccc1a into master May 9, 2020
@ryanve ryanve deleted the and branch May 9, 2020 00:44
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