microsoft / damlev

:memo: The fastest JS implementation of the Damerau-Levenshtein edit distance
MIT License
14 stars 3 forks source link

gotta go even faster #1

Closed SimonSchick closed 8 years ago

SimonSchick commented 8 years ago

local test is about 5% faster.

SimonSchick commented 8 years ago

Also fixed global variable leak 😛

connor4312 commented 8 years ago

I tried running both branches on my machine, running them twice to eliminate any weird warmups. Results:

                      head-to-head
          19,591 op/s » master
          20,193 op/s » speed-improvements
          20,148 op/s » master
          19,613 op/s » speed-improvements

  Suites:  1
  Benches: 4
  Elapsed: 53,147.79 ms
SimonSchick commented 8 years ago

This is odd, on my machine I got an average of 5%.

What node version were you running?

connor4312 commented 8 years ago

These were the results on the raccoons VM, much less noisy (+/- under 40 ops/sec):

                      head-to-head
          20,906 op/s » master
          20,540 op/s » speed-improvements
          20,939 op/s » master
          20,517 op/s » speed-improvements

  Suites:  1
  Benches: 4
  Elapsed: 53,380.37 ms

Both Node 4.x

SimonSchick commented 8 years ago

That explains that, I ran it against v6 since that uses the newest v8 engine, if you want you can close this, but please fix the global variable leak (and possible add strict mode to prevent them in the future).

SimonSchick commented 8 years ago

Feel free to close this PR, but you might want to run it against v6 and inside a browser as well.

Also make sure to fix that global leak.

connor4312 commented 8 years ago

sure thing