Conversation
Skip the %XX walk in unescapeBuffer when the input has no '%'. Add a dedicated '&'/'=' scanner for the default parse path so it does not build separator code arrays or run the multi-char state machine. Official benchmark/querystring/querystring-parse.js: encodemany is about 38% faster, manyblankpairs about 17%, encodelast about 10%, noencode about 8%. Official querystring-unescapebuffer.js with no escapes is about 36% faster. Assisted-by: a closed-source coding agent Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com> Co-authored-by: Yagiz Nizipli <anonrig@users.noreply.github.com>
jasnell
approved these changes
Sep 21, 2026
Collaborator
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66175 +/- ##
==========================================
+ Coverage 90.27% 90.30% +0.03%
==========================================
Files 790 790
Lines 271651 272173 +522
Branches 51842 51978 +136
==========================================
+ Hits 245228 245785 +557
+ Misses 16928 16885 -43
- Partials 9495 9503 +8
🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Skip the
%XXwalk inunescapeBufferwhen the input has no%, and add a dedicated'&'/'='scanner for the defaultquerystring.parse()path so it does not build separator code arrays or run the multi-character state machine.Custom separators,
maxKeys,decodeURIComponent, and a replacedquerystring.unescapestill use the existing parser.This change was implemented with assistance from a closed-source coding agent. I verified the source, official
benchmark/querystringresults, andtest-querystring.js.Official benches
Three-run medians,
n=1e6:querystring-parse.jsencodemanyquerystring-parse.jsmanyblankpairsquerystring-parse.jsencodelastquerystring-parse.jsnoencodequerystring-unescapebuffer.js(no escapes)Tests
test-querystring.jsand the othertest-querystring-*.jsfiles.