-
-
Notifications
You must be signed in to change notification settings - Fork 693
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: Optimize proxify and stringDistance (#1098)
- Fill 2D array with ints upfront to reduce property access cost - Change from recursive to simpler iterative (DP) solution - Add cap parameter to stringDistanceCapped to limit computation - Make candidate generation use a simple loop to avoid allocating unnecessary arrays and to call stringDistance only once on each pair of strings instead of every time in the sort callback This improves chai perf by about 13% on @bmeurer's https://github.com/v8/web-tooling-benchmark.
- Loading branch information
1 parent
f54f71c
commit c02f64b
Showing
1 changed file
with
53 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters