krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
17.79k stars 756 forks source link

perf(speed): improve execution speed #555

Closed joshiayush closed 2 years ago

joshiayush commented 3 years ago

Modification 1

add guard clause to improve execution speed, this is also a great alternative to if ... else if ... ladder as it improves code readability

This modification doesn't affect the functionality of library Fuse negatively but improves performance

Tests

Screenshot from 2021-05-21 17-13-18

Modification 2

update node engine to >13 to use Fuse on the front-end as well as on the back-end, because node engines that has a version greater than 13 supports import, export statements

Modification 3

use custom exceptions instead of error messages this makes a good software design