-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
src: improve StreamBase write throughput #23843
Conversation
Improve performance by transferring information about write status to JS through an `AliasedBuffer`, rather than object properties set from C++.
Benchmarks looked good but had some isolated negative instances – I’d like to make sure these aren’t real performance regressions… Benchmark CI again ( |
Think I figured out why the benchmarks had that weird drop for ASCII writes. (Edit: No, my mistake.) New benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/254/ |
So … the most recent full benchmark (https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/254/) shows a significant -8 % regression for one of the large-buffer ASCII variants of a benchmark. Running only that benchmark with a few more iterations (https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/255/) shows a significant 5 % increase. (I did not reproduce either locally.) I don’t quite know how to make sense of that – I don’t understand how this patch would lead to a regression, and the high significance levels in the different benchmarks would make my first guess that it’s related to how we benchmark things, so I’d feel comfortable going ahead with it (especially in like of the more common significant improvements), but I wanted to point this out in case anybody felt differently. |
Resume CI again: https://ci.nodejs.org/job/node-test-pull-request/18182/ |
Improve performance by transferring information about write status to JS through an `AliasedBuffer`, rather than object properties set from C++. PR-URL: nodejs#23843 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]>
Landed in f01518e |
Improve performance by transferring information about write status to JS through an `AliasedBuffer`, rather than object properties set from C++. PR-URL: #23843 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]>
Improve performance by transferring information about write status to JS through an `AliasedBuffer`, rather than object properties set from C++. PR-URL: #23843 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]>
Is this something we would want to backport to LTS? I'm assuming it would likely have to be the entire StreamBase refactor in one go. |
I think it might be better not to.
Not really, no. It’s like all other changes – some commits make sense to backport, others have a nonzero risk of breakage (although I try to run CITGM on all of them). |
Improve performance by transferring information about write status
to JS through an
AliasedBuffer
, rather than object propertiesset from C++.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes