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

querystring: simplify stringify method #26591

Closed
wants to merge 1 commit into from

Conversation

ZYSzys
Copy link
Member

@ZYSzys ZYSzys commented Mar 11, 2019

Since there is no obvious improvement in stringify method, try to simplify stringify method without performance regression.

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 querystring Issues and PRs related to the built-in querystring module. label Mar 11, 2019
@mscdex
Copy link
Contributor

mscdex commented Mar 11, 2019

Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/303/console

These results show a slight regression for type=encodelast.

lib/querystring.js Outdated Show resolved Hide resolved
@ZYSzys
Copy link
Member Author

ZYSzys commented Mar 19, 2019

CI: https://ci.nodejs.org/job/node-test-pull-request/21657/

Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/305/console

17:41:31                                                                    confidence improvement accuracy (*)   (**)  (***)
17:41:31  querystring/querystring-stringify.js n=10000000 type='array'                      0.27 %       ±0.97% ±1.30% ±1.69%
17:41:31  querystring/querystring-stringify.js n=10000000 type='array0'            ***      2.52 %       ±0.88% ±1.17% ±1.52%
17:41:31  querystring/querystring-stringify.js n=10000000 type='encodelast'                -0.09 %       ±1.05% ±1.40% ±1.82%
17:41:31  querystring/querystring-stringify.js n=10000000 type='encodemany'                -0.77 %       ±1.14% ±1.52% ±1.99%
17:41:31  querystring/querystring-stringify.js n=10000000 type='noencode'                   1.01 %       ±1.70% ±2.27% ±2.95%

So slightly the performance improved, but at least an improvement right ?

/cc @mscdex @BridgeAR PTAL :)

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes are LGTM. The case optimized is very rare, thus adding extra benchmark types does not seem right to me.

benchmark/querystring/querystring-stringify.js Outdated Show resolved Hide resolved
benchmark/querystring/querystring-stringify.js Outdated Show resolved Hide resolved
@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 25, 2019
@nodejs-github-bot
Copy link
Collaborator

@ZYSzys ZYSzys changed the title querystring: slightly improve stringify performance querystring: simplify stringify method Mar 27, 2019
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Mar 27, 2019

@nodejs-github-bot
Copy link
Collaborator

BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Apr 4, 2019
PR-URL: nodejs#26591
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@BridgeAR
Copy link
Member

BridgeAR commented Apr 4, 2019

Landed in b965ac2 🎉

@BridgeAR BridgeAR closed this Apr 4, 2019
@ZYSzys ZYSzys deleted the qs-stringify branch April 4, 2019 15:00
BethGriggs pushed a commit that referenced this pull request Apr 9, 2019
PR-URL: #26591
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
@BethGriggs BethGriggs mentioned this pull request Apr 9, 2019
BethGriggs pushed a commit that referenced this pull request Apr 10, 2019
PR-URL: #26591
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. querystring Issues and PRs related to the built-in querystring module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants