-
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
url: spec-compliant URLSearchParams parser #11858
Closed
TimothyGu
wants to merge
5
commits into
nodejs:master
from
TimothyGu:urlsearchparams-fork-querystring
Closed
url: spec-compliant URLSearchParams parser #11858
TimothyGu
wants to merge
5
commits into
nodejs:master
from
TimothyGu:urlsearchparams-fork-querystring
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nodejs-github-bot
added
dont-land-on-v4.x
querystring
Issues and PRs related to the built-in querystring module.
whatwg-url
Issues and PRs related to the WHATWG URL implementation.
labels
Mar 15, 2017
Rerun of CI after last commit: https://ci.nodejs.org/job/node-test-pull-request/6855/ |
jasnell
approved these changes
Mar 16, 2017
@mscdex, I'd like you to take a look at this if possible since you wrote the optimized |
joyeecheung
approved these changes
Mar 16, 2017
watilde
approved these changes
Mar 17, 2017
Unless there are any additional comments (ping @mscdex) I'm going to merge this tomorrow. |
TimothyGu
added a commit
that referenced
this pull request
Mar 22, 2017
PR-URL: #11858 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Landed in a1028d5...c515a98. |
this will need to be manually backported to v7.x |
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
querystring
Issues and PRs related to the built-in querystring module.
whatwg-url
Issues and PRs related to the WHATWG URL implementation.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Performance is also drastically improved, so that
URLSearchParams
is on average 150% faster thanquerystring.parse
.The
URLSearchParams
parser is in fact forked from thequerystring.parse
, with the following changes:key
andvalue
variables are now merged into onebuf
sep
andeq
is removedlastPos
was formerly used for two different purposes: as the starting position of a pair and as the (index + 1) of the last-added buffer; split it into two variablesSome of these changes may be able to be backported to
querystring
. In particular, 4 and 5 may fix actual bugs in the querystring implementation (e.g. currentlyquerystring.parse('+') => {}
). I will investigate that after this PR is landed.After this PR, the
URLSearchParams
class will be fully spec-compliant 🎉Fixes: #10821
Benchmark: before vs. after (avg. 240% improvement)
Benchmark: legacy (
querystring
) vs. WHATWG (avg. 150% improvement)Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
querystring, url