-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: add fast-path for readable streams #45489
Conversation
Review requested:
|
I don't link the decrease for latin1. |
@mcollina I updated the pr description with the CI result. My educated guess would be; its because of normalizeEncoding |
Can't we make |
We can't because |
e2ac788
to
9f72045
Compare
I force pushed and fixed the tests. Will be running a new benchmark soon. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Overall this change LGTM but, like @mcollina I am concerned about the regression on latin1. I'd like to see if there's a way to avoid that here. |
This comment was marked as outdated.
This comment was marked as outdated.
9f72045
to
76a866f
Compare
76a866f
to
85f49ea
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.
This change requires a bit more work due to readable-stream
extraction that this will break due to the new dependencies:
FastBuffer
and TextEncoder
and normalizeEncoding
might not be available. Could you put all that logic in a function imported from a different file? In this way it would be significantly easier to replace.
85f49ea
to
853ecc4
Compare
It seems I forgot to add |
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1228/ Results
|
Commit Queue failed- Loading data for nodejs/node/pull/45489 ✔ Done loading data for nodejs/node/pull/45489 ----------------------------------- PR info ------------------------------------ Title stream: add fast-path for readable streams (#45489) Author Yagiz Nizipli (@anonrig) Branch anonrig:perf/stream-encoding -> nodejs:main Labels stream, performance, needs-ci Commits 2 - stream: add fast-path for readable streams - fixup! stream: add fast-path for readable streams Committers 1 - Yagiz Nizipli PR-URL: https://github.com/nodejs/node/pull/45489 Reviewed-By: Antoine du Hamel Reviewed-By: Matteo Collina ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/45489 Reviewed-By: Antoine du Hamel Reviewed-By: Matteo Collina -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last review: ⚠ - fixup! stream: add fast-path for readable streams ℹ This PR was created on Wed, 16 Nov 2022 19:23:56 GMT ✔ Approvals: 2 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/45489#pullrequestreview-1187122865 ✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/45489#pullrequestreview-1187113060 ✔ Last GitHub CI successful ℹ Last Benchmark CI on 2022-11-21T18:10:58Z: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1228/ ℹ Last Full PR CI on 2022-11-21T18:10:00Z: https://ci.nodejs.org/job/node-test-pull-request/48072/ - Querying data for job/node-test-pull-request/1228/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/3518963825 |
The perf look worse for chunk of length 256, should we use the "fast-path" only when |
19bc7e4
to
9ecac0b
Compare
(Hopefully last) Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1243/ |
This does not seems to be helping:
|
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1225/
Results