Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbuffer: improve equals() performance #29199
Conversation
mscdex
added
buffer
performance
labels
Aug 19, 2019
This comment has been minimized.
This comment has been minimized.
mscdex
force-pushed the
mscdex:buffer-equals-perf
branch
from
cf617f4
to
8ffa33f
Aug 19, 2019
This comment has been minimized.
This comment has been minimized.
| const common = require('../common.js'); | ||
|
|
||
| const bench = common.createBenchmark(main, { | ||
| size: [0, 16, 512, 4096, 16386], |
This comment has been minimized.
This comment has been minimized.
BridgeAR
Aug 19, 2019
Member
It should be sufficient to just keep e.g., 0, 512 and 16386. The other options are just intermediate steps.
This comment has been minimized.
This comment has been minimized.
mscdex
Aug 19, 2019
Author
Contributor
FWIW I copied this from buffer-compare.js, does that mean that should be changed as well?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Need to add |
This comment has been minimized.
This comment has been minimized.
Confirmed. This is needed. I tried to add a fixup commit but I don't have permission to the branch. |
|
LGTM but needs a change to avoid breaking test-benchmark-buffer |
This comment has been minimized.
This comment has been minimized.
|
Shouldn't the test fail if it was breaking? |
mscdex
force-pushed the
mscdex:buffer-equals-perf
branch
from
8ffa33f
to
f3f3b97
Aug 21, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
benchmark tests only run nightly in CI and only if you run |
| @@ -26,6 +26,7 @@ runBenchmark('buffers', | |||
| 'source=array', | |||
| 'type=', | |||
| 'value=0', | |||
| 'withTotalLength=0' | |||
| 'withTotalLength=0', | |||
| 'difflen=false' | |||
This comment has been minimized.
This comment has been minimized.
Trott
Aug 21, 2019
Member
Super minor optional nit: The rest of the options are alphabetized. Can this go after line 14 intstead?
|
LGTM with or without my additional optional nit |
mscdex
force-pushed the
mscdex:buffer-equals-perf
branch
from
f3f3b97
to
c7fe371
Aug 22, 2019
mscdex
force-pushed the
mscdex:buffer-equals-perf
branch
from
c7fe371
to
36f9f73
Aug 22, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Landed in f0c8898 |
mscdex commentedAug 19, 2019
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