Repository navigation
Conversation
Reuse precomputed escapes for Latin-1 characters instead of joining two byte escapes on every occurrence. This reduces repeated work when querystring and URLSearchParams serialize these characters. Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
Collaborator
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66756 +/- ##
==========================================
+ Coverage 90.48% 90.50% +0.01%
==========================================
Files 791 797 +6
Lines 277204 277509 +305
Branches 53311 53323 +12
==========================================
+ Hits 250841 251165 +324
+ Misses 16760 16750 -10
+ Partials 9603 9594 -9
🚀 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.
Precompute percent-encoded strings for the 128 non-ASCII Latin-1 characters instead of joining two byte escapes on every occurrence. This reduces repeated work when
querystringandURLSearchParamsserialize query parameters containing characters such asé. Other character ranges are unchanged; the tradeoff is a fixed 128-entry lookup table.Benchmarks on Apple M2/macOS against dd7235c show higher throughput
querystring.stringifyworkload (+31.9%)querystring.escapeworkloads (+48–56%)URLSearchParamsconstruction and serialization (+25–49% for dense Latin-1 and +4–11% for mixed ASCII/Latin-1)Across 48 cases and 5,760 samples, eight gains in both comparisons were confirmed after Holm correction, with no statistically significant regressions, including startup controls.