-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
stream: simplify Writable.write #31146
Conversation
e5ca143
to
4741a70
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with green CITGM
@nodejs/streams |
|
@BridgeAR: Applied your comment regarding typeof vs instanceof here as well |
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/499/console
Seems like a lot of bad regressions... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Performance regressions should be resolved first
I'm a little confused what happened here. Passing I've slightly changed this to not include the streams/writable-manywrites.js callback='no' writev='no' sync='no' n=2000000 ** 2.84 % ±1.80% ±2.38% ±3.08%
streams/writable-manywrites.js callback='no' writev='no' sync='yes' n=2000000 -1.17 % ±1.80% ±2.39% ±3.12%
streams/writable-manywrites.js callback='no' writev='yes' sync='no' n=2000000 ** 2.03 % ±1.23% ±1.62% ±2.09%
streams/writable-manywrites.js callback='no' writev='yes' sync='yes' n=2000000 -1.34 % ±2.10% ±2.82% ±3.71%
streams/writable-manywrites.js callback='yes' writev='no' sync='no' n=2000000 1.26 % ±1.47% ±1.95% ±2.51%
streams/writable-manywrites.js callback='yes' writev='no' sync='yes' n=2000000 -0.73 % ±2.41% ±3.21% ±4.21%
streams/writable-manywrites.js callback='yes' writev='yes' sync='no' n=2000000 ** 2.30 % ±1.39% ±1.84% ±2.39%
streams/writable-manywrites.js callback='yes' writev='yes' sync='yes' n=2000000 1.45 % ±2.27% ±3.04% ±4.01% |
4eb510d
to
7e59633
Compare
@ronag I think it makes sense to keep the encoding part in the benchmark. That way it's easier to identify regressions. |
But right now the encoding part doesn't do anything with |
@mscdex the performance issue is resolved. PTAL. |
rebased |
e19ef3a
to
bf34c46
Compare
bf34c46
to
b3e3180
Compare
@mcollina: Just a quick post rebase LGTM before landing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I believe this was resolved in a different commit related to http2. |
Landed in 194f2e20db11 |
Slightly refactors Writable.write for minor perf and readability improvements. PR-URL: #31146 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: David Carlier <[email protected]>
@ronag this'll need manual bp it looks like, but feel free to swap out the label with |
@MylesBorins this will now land cleanly on 13.x-staging |
Slightly refactors Writable.write for minor perf and readability improvements. PR-URL: #31146 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: David Carlier <[email protected]>
Simplifies
Writable.write
and adds an optimization where if you pass'buffer'
as theencoding
parameter towrite(chunk, encoding, cb)
it will bypass a slow path where we check whetherchunk
is aBuffer
or not.#31146 (comment)
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes