-
Notifications
You must be signed in to change notification settings - Fork 86
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
Added sublime fuzzy search behavior. #12
base: master
Are you sure you want to change the base?
Conversation
👍 |
Awesome! Have you run any benchmarks to test performance? |
Haven't run benchmarks yet. Will try to do so in the next few days and update. |
Any update on this? new features added by @kseth would be awesome |
Sorry for the delay @mattyork, ran some basic performance tests comparing the PR and the existing fuzzy functionality. I ran these tests on node v5.6.0, averaged over 1,000,000 iterations, testing the fuzzy.match function.
'abcd' in 'abcdefgh' should be the best case scenario for the PR and even there performance is impacted negatively by something like 2x (probably because v8 better optimizes for iteration compared to recursion). 'bass' in 'bodacious bass' and 'rice' in 'reactive rice' are expected to be slower because the PR adds functionality for finding better fuzzy matches. I can do some more testing if you think these basic preliminary results aren't too damaging for this PR. |
Fixes #3 |
Any update on the status of this pull request? |
@mattyork anything we can do to speed this up? |
any update here? |
well if you are still interesting by this feature (which will be a bit surprised, been while there is no update on this, but well just in case :D), I implemented the algo here: https://github.com/Nexucis/fuzzy |
Fuzzy search now performs true 'sublime' like behavior.
Given a word with length
n
and a search query with lengthm
, the new algorithm takes something like:O((|n-m|+1)(m))
.Uncommented two tests.
It also has the behavior preferred by the third test (still
xit
): it prefers highly ranked words where the search query appears closer to the beginning of the word.