Thoughts about Nucleo? #3491
Replies: 1 comment 4 replies
-
Some initial thoughts after skimming through the page. It looks like a Rust implementation of the fzf algorithm with some tweaks. Nothing groundbreaking.
I wouldn't be surprised if a Rust implementation of the same algorithm is faster because you have more low-level control (e.g. no runtime GC) and thus more room for optimization. But does it really matter? At the current level of performance, any performance gain in the matching algorithm will be of marginal benefit to users, because fzf is already fast for most practical scenarios.
This statement is technically incorrect and misleading. The fzf algorithm is guaranteed to give you the optimal result according to its scoring model. It's a misuse of the term "optimal". Anyway, what they are saying is that they feel their scoring model gives more "natural", "intuitive" results, but the feeling of "intuitiveness" is subjective and we don't have an objective measure. And it can vary greatly depending on the context. There is no one-size-fits-all model that will always produce the most "intuitive" result for all types of input for all users with different expectations.
I didn't understand this part. What exactly are we doing? Is this what the author is testing? If that's the case, no, fzf doesn't prefer $ (echo x__foo; echo xf_oo) | fzf -f 'xf foo' | head -1
x__foo
This part was particularly interesting. It took 2~3 seconds for fzf to finish the search, and it took about 12 seconds for the helix editor to finish the search. At the end of the day, this is what matters to end users, so for them, fzf is 5 times faster. This clicks with my point that improving the matching algorithm's performance won't yield significant benefits for users. Also, the test was run against 3 million items. But how often do you use fzf with that many items? Most of the time you'll be filtering maybe a few thousands, or a few tens of thousands of items, and in that realm, the performance difference will shrink to maybe a few milliseconds or a fraction of a millisecond and it won't be noticeable anyway. So I believe my time is better spent in different areas of the program. If I'm going to work on the performance, I'd like to make the initial loading faster. (Theoretically, fzf could do more work in the loading phase and make the subsequent filtering faster, but we don't do that because it results in a worse user experience.) |
Beta Was this translation helpful? Give feedback.
-
Hi
In their latest release, the Helix text-editor exposed some details about their underlying fuzzy-matching library: https://helix-editor.com/news/release-23-10-highlights/
Reading more about this project, called Nucleo, I found refreshing that the README acknowledge fzf as a strong source of technical inspiration : https://github.com/helix-editor/nucleo
Then, the authors of this library claims that they manage to squeeze even more performance.
I'm not too verse into the intricacies of the various algorithms existing in the design space of "fuzzy engines", but I just wonder if there may be a few learning in the approach adopted by Nucleo that could benefit back to fzf?
Beta Was this translation helpful? Give feedback.
All reactions