buffer,util: refactor for performance#12153
Closed
Trott wants to merge 1 commit intonodejs:masterfrom
Closed
Conversation
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.
Member
Author
$ 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
$ |
Member
Author
joyeecheung
approved these changes
Apr 1, 2017
targos
approved these changes
Apr 2, 2017
Contributor
|
I thought the idea was to use these in other places @thefourtheye ? |
jasnell
approved these changes
Apr 3, 2017
Member
|
@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. |
jasnell
pushed a commit
that referenced
this pull request
Apr 4, 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: #12153 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
Member
|
Landed in 1e6186e |
|
cc @Trott |
Trott
added a commit
to Trott/io.js
that referenced
this pull request
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]>
2 tasks
Member
Author
Trott
added a commit
to Trott/io.js
that referenced
this pull request
Apr 21, 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]>
Merged
evanlucas
pushed a commit
that referenced
this pull request
May 1, 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: #12153 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
Contributor
|
should we backport to v6.x? I've added the baking label as we should wait a bit if it is going to land |
Contributor
|
I am going to take a wild guess here. The performance improvement seen here could be because of the hidden |
4 tasks
Member
Author
|
@MylesBorins Backport to v6.x PR: #13046 |
Trott
added a commit
to Trott/io.js
that referenced
this pull request
May 19, 2017
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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