buffer: improve equals() performance#29199
Conversation
cf617f4 to
8ffa33f
Compare
benchmark/buffers/buffer-equals.js
Outdated
There was a problem hiding this comment.
It should be sufficient to just keep e.g., 0, 512 and 16386. The other options are just intermediate steps.
There was a problem hiding this comment.
FWIW I copied this from buffer-compare.js, does that mean that should be changed as well?
|
Need to add |
Confirmed. This is needed. I tried to add a fixup commit but I don't have permission to the branch. |
Trott
left a comment
There was a problem hiding this comment.
LGTM but needs a change to avoid breaking test-benchmark-buffer
|
Shouldn't the test fail if it was breaking? |
8ffa33f to
f3f3b97
Compare
benchmark tests only run nightly in CI and only if you run |
There was a problem hiding this comment.
Super minor optional nit: The rest of the options are alphabetized. Can this go after line 14 intstead?
Trott
left a comment
There was a problem hiding this comment.
LGTM with or without my additional optional nit
f3f3b97 to
c7fe371
Compare
c7fe371 to
36f9f73
Compare
|
Landed in f0c8898 |
PR-URL: nodejs#29199 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: #29199 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Results:
I'm not sure offhand what's up with the large variance for
size=16386, especially since trying the samenvalue as the other cases actually resulted in an even larger variance. Anyway, the actual numbers don't really matter so much as the trend.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes