GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing github.com — url: create URLSearchParams collision map lazily by RomainLanz · Pull Request #65801 · nodejs/node Conversation
Contributor
Note AI assistance was used to investigate this change and draft parts of the Hey! 👋
Most property names do not need this map. JavaScript object keys are already unique, so no collision is possible while A map is only needed when a property name contains malformed UTF-16. '\uFFFDx' // remains '\uFFFDx' '\uD835x' // becomes '\uFFFDx' This change appends entries directly while keys remain unchanged. When the first key changes during conversion, it creates the A test covers a collision occurring after regular keys have already been processed. BenchmarkNode v27.0.0-pre, V8 14.6.202.34-node.29, 15 runs with 4 million constructions per run: node benchmark/compare.js \ --old ./node-before \ --new ./node-after \ --runs 15 \ --filter url-searchparams-creation \ --set inputType=object \ --set type=noencode \ --set type=multiprimitives \ --set type=array \ --set n=4000000 \ url
For ten-property records, a separate GC diagnostic measured:
A conversion-heavy TCP loopback benchmark improved from 857k to 1.14M frames/s (+33%). This only demonstrates the cumulative effect when The malformed-key fallback measured 544.4 → 550.9 ns/op, around 1.2% slower and within the observed noise. This rare path now pays for creating and backfilling the map. TestsThe focused constructor test, the URLSearchParams fast-path test, and the URL
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Object property keys are already unique unless USVString normalization changes a key. Avoid allocating and updating a SafeMap for ordinary record keys. Create and backfill it when normalization first changes a key. This improves object construction by 10% to 25% in the measured cases and reduces allocation by about 31% for a ten-property record. Assisted-by: Amp Signed-off-by: Romain Lanz <[email protected]>
RomainLanz
force-pushed
the
perf/urlsearchparams-lazy-map
branch
from
3f30ad2 to
2fb7b16
Compare
|
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #65801 +/- ## ========================================== - Coverage 90.17% 90.13% -0.04% ========================================== Files 769 769 Lines 261448 261638 +190 Branches 49674 49673 -1 ========================================== + Hits 235759 235831 +72 - Misses 16736 16812 +76 - Partials 8953 8995 +42
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Could someone trigger the CI for this PR when they have a chance? Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Are the failure linked to my changes? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Landed in 464cbbd |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Object property keys are already unique unless USVString normalization changes a key. Avoid allocating and updating a SafeMap for ordinary record keys. Create and backfill it when normalization first changes a key. This improves object construction by 10% to 25% in the measured cases and reduces allocation by about 31% for a ten-property record. Assisted-by: Amp Signed-off-by: Romain Lanz <[email protected]> PR-URL: #65801 Reviewed-By: James M Snell <[email protected]>
Object property keys are already unique unless USVString normalization changes a key. Avoid allocating and updating a SafeMap for ordinary record keys. Create and backfill it when normalization first changes a key. This improves object construction by 10% to 25% in the measured cases and reduces allocation by about 31% for a ten-property record. Assisted-by: Amp Signed-off-by: Romain Lanz <[email protected]> PR-URL: nodejs#65801 Reviewed-By: James M Snell <[email protected]>
Object property keys are already unique unless USVString normalization changes a key. Avoid allocating and updating a SafeMap for ordinary record keys. Create and backfill it when normalization first changes a key. This improves object construction by 10% to 25% in the measured cases and reduces allocation by about 31% for a ten-property record. Assisted-by: Amp Signed-off-by: Romain Lanz <[email protected]> PR-URL: #65801 Reviewed-By: James M Snell <[email protected]>
Object property keys are already unique unless USVString normalization changes a key. Avoid allocating and updating a SafeMap for ordinary record keys. Create and backfill it when normalization first changes a key. This improves object construction by 10% to 25% in the measured cases and reduces allocation by about 31% for a ten-property record. Assisted-by: Amp Signed-off-by: Romain Lanz <[email protected]> PR-URL: #65801 Reviewed-By: James M Snell <[email protected]>
Object property keys are already unique unless USVString normalization changes a key. Avoid allocating and updating a SafeMap for ordinary record keys. Create and backfill it when normalization first changes a key. This improves object construction by 10% to 25% in the measured cases and reduces allocation by about 31% for a ten-property record. Assisted-by: Amp Signed-off-by: Romain Lanz <[email protected]> PR-URL: #65801 Reviewed-By: James M Snell <[email protected]>
Object property keys are already unique unless USVString normalization changes a key. Avoid allocating and updating a SafeMap for ordinary record keys. Create and backfill it when normalization first changes a key. This improves object construction by 10% to 25% in the measured cases and reduces allocation by about 31% for a ten-property record. Assisted-by: Amp Signed-off-by: Romain Lanz <[email protected]> PR-URL: #65801 Reviewed-By: James M Snell <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.