Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
buffer,util: refactor for performance#12153
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
Trott commented Apr 1, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
internal/util.js definied toInteger() and toLength() but they were only used by buffer.js. Inlining these small functions results in a small but statistically-significant performance gain.
Trott commented Apr 1, 2017
$ node benchmark/compare.js --old /var/tmp/node-master --new /var/tmp/node-new --filter buffer-from --set 'source=arraybuffer' --set 'source=arraybuffer-middle' buffers > /var/tmp/compare.csv[00:01:09|% 100| 1/1 files | 60/60 runs | 4/4 configs]: Done $ cat /var/tmp/compare.csv | Rscript benchmark/compare.R improvement confidence p.value buffers/buffer-from.js n=1024 len=10 source="arraybuffer-middle" 7.12 % *** 1.415439e-18 buffers/buffer-from.js n=1024 len=10 source="arraybuffer" 0.05 % 9.482883e-01 buffers/buffer-from.js n=1024 len=2048 source="arraybuffer-middle" 4.91 % ** 2.134363e-03 buffers/buffer-from.js n=1024 len=2048 source="arraybuffer" 0.94 % 2.267840e-01 $ |
Trott commented Apr 1, 2017
cjihrig commented Apr 3, 2017
I thought the idea was to use these in other places @thefourtheye ? |
jasnell commented Apr 4, 2017
@cjihrig ... I'm sure it could be, but until there's a need for that, this should be fine. We can revert this if it proves necessary. |
internal/util.js definied toInteger() and toLength() but they were only used by buffer.js. Inlining these small functions results in a small but statistically-significant performance gain. PR-URL: #12153 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
jasnell commented Apr 4, 2017
Landed in 1e6186e |
italoacasas commented Apr 10, 2017
cc @Trott |
internal/util.js definied toInteger() and toLength() but they were only used by buffer.js. Inlining these small functions results in a small but statistically-significant performance gain. PR-URL: nodejs#12153 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
Trott commented Apr 11, 2017
internal/util.js definied toInteger() and toLength() but they were only used by buffer.js. Inlining these small functions results in a small but statistically-significant performance gain. PR-URL: nodejs#12153 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
internal/util.js definied toInteger() and toLength() but they were only used by buffer.js. Inlining these small functions results in a small but statistically-significant performance gain. PR-URL: #12153 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
MylesBorins commented May 15, 2017
should we backport to v6.x? I've added the baking label as we should wait a bit if it is going to land |
thefourtheye commented May 15, 2017
I am going to take a wild guess here. The performance improvement seen here could be because of the hidden |
Trott commented May 16, 2017
@MylesBorins Backport to v6.x PR: #13046 |
internal/util.js defined toInteger() and toLength() but they were only used by buffer.js. Inlining these small functions results in a small but statistically-significant performance gain. PR-URL: nodejs#12153 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
internal/util.jsdefiniedtoInteger()andtoLength()but they were onlyused by
lib/buffer.js. Inlining these small functions results in a small butstatistically-significant performance gain.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
buffer util