Skip to content
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

perf: Optimize proxify and stringDistance #1098

Merged
merged 1 commit into from Jan 7, 2018

Commits on Dec 2, 2017

  1. perf: Optimize proxify and stringDistance

    - 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.
    sophiebits committed Dec 2, 2017
    Copy the full SHA
    5467f07 View commit details
    Browse the repository at this point in the history