-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
url: spec-compliant URLSearchParams parser #11858
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
Conversation
|
Rerun of CI after last commit: https://ci.nodejs.org/job/node-test-pull-request/6855/ |
|
@mscdex, I'd like you to take a look at this if possible since you wrote the optimized |
|
Unless there are any additional comments (ping @mscdex) I'm going to merge this tomorrow. |
PR-URL: #11858 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]>
The entire `URLSearchParams` class is now fully spec-compliant. PR-URL: #11858 Fixes: #10821 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]>
|
Landed in a1028d5...c515a98. |
|
this will need to be manually backported to v7.x |
Performance is also drastically improved, so that
URLSearchParamsis on average 150% faster thanquerystring.parse.The
URLSearchParamsparser is in fact forked from thequerystring.parse, with the following changes:keyandvaluevariables are now merged into onebufsepandeqis removedlastPoswas 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
URLSearchParamsclass 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