Skip to content
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: refactor the objectMode assignment logic #32949

Closed
wants to merge 1 commit into from

Conversation

rickyes
Copy link
Contributor

@rickyes rickyes commented Apr 20, 2020

~7% improvement. reduce repetitive judgments when options is undefined.

 streams/creation.js kind='duplex' n=50000000                    0.85 %      ±3.68% ±4.90% ±6.37%
 streams/creation.js kind='readable' n=50000000         ***      6.89 %      ±3.93% ±5.25% ±6.85%
 streams/creation.js kind='transform' n=50000000                 0.17 %      ±4.49% ±5.99% ±7.82%
 streams/creation.js kind='writable' n=50000000                 -1.35 %      ±3.37% ±4.48% ±5.84%

/cc @ronag

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Apr 20, 2020
@ronag
Copy link
Member

ronag commented Apr 20, 2020

Didn't notice any performance diff when running locally, trying Benchmark CI.

https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/566/

@rickyes
Copy link
Contributor Author

rickyes commented Apr 21, 2020

After I conducted another benchmark test locally, there was no performance difference. The difference between the two results was so big, I will close this PR.

@rickyes rickyes closed this Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants