Closed dabuside closed 5 years ago
It wouldn't make a huge difference without re-architecting some things. Ultimately you need to score all of the entries to find out the top entries, and that's where all the performance critical work is.
Agreed, @heyimalex.
It wouldn't make a huge difference without re-architecting some things. Ultimately you need to score all of the entries to find out the top entries, and that's where all the performance critical work is.
It may not need to score all of the entries, just to find a limit number of the result that meets the threshold(early returns, left the rest unvisited).
I've found the limit option on code, but it's not used. https://github.com/krisk/Fuse/blob/fe1ff83645a55b6ea9f9488893a32495c132529f/src/index.js#L100-L102
@dabuside You're right that it'd be possible, but how often would it be used? The vast majority of people want the best matches, not the first x matches that crossed the threshold.
That code you linked runs after scoring.
@dabuside You're right that it'd be possible, but how often would it be used? The vast majority of people want the best matches, not the first x matches that crossed the threshold.
That code you linked runs after scoring.
oops. You're right.
When searching in a large object, there may be too many results. Adding a maxMatchSize option would reduce the perform issue by early returns.