-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Add SourceMap Benchmark #58125
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
base: main
Are you sure you want to change the base?
Add SourceMap Benchmark #58125
Conversation
Review requested:
|
5e438af
to
4147ff3
Compare
You need to add a test for these benchmarks. You can find similar ones in test folder. |
Thank you, just pushed that! |
5749fce
to
bc9fbe9
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58125 +/- ##
==========================================
+ Coverage 90.07% 90.09% +0.02%
==========================================
Files 640 640
Lines 188262 188262
Branches 36912 36911 -1
==========================================
+ Hits 169580 169623 +43
+ Misses 11399 11363 -36
+ Partials 7283 7276 -7 🚀 New features to boost your workflow:
|
f1040cd
to
421ae12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the change! Overall LGTM % nits.
02b5acc
to
7eab302
Compare
c7232d1
to
ac7a40e
Compare
'findOrigin', | ||
'findOrigin-sectioned', | ||
], | ||
n: [1e5], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
n: [1e5], | |
n: [1e5], |
Is this an arbitrary number, or did you find that this is the curve where benchmark results do not change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I had some testing for 10
up to 1e8
and it stabilizes around 1e5
.
For source-map-cache
source_map/source-map-cache.js n=10 operation="findSourceMap-valid": 22,044.640396803527
source_map/source-map-cache.js n=100 operation="findSourceMap-valid": 114,264.03676559647
source_map/source-map-cache.js n=1000 operation="findSourceMap-valid": 135,848.8002852825
source_map/source-map-cache.js n=10000 operation="findSourceMap-valid": 425,194.9252985665
source_map/source-map-cache.js n=100000 operation="findSourceMap-valid": 661,039.200292227
source_map/source-map-cache.js n=1000000 operation="findSourceMap-valid": 655,766.5874586097
source_map/source-map-cache.js n=10000000 operation="findSourceMap-valid": 686,861.3520220064
source_map/source-map-cache.js n=100000000 operation="findSourceMap-valid": 690,901.4430697807
source_map/source-map-cache.js n=10 operation="findSourceMap-generated-source": 19,123.493785820694
source_map/source-map-cache.js n=100 operation="findSourceMap-generated-source": 222,985.82479111804
source_map/source-map-cache.js n=1000 operation="findSourceMap-generated-source": 1,262,360.0831642824
source_map/source-map-cache.js n=10000 operation="findSourceMap-generated-source": 3,751,348.609825232
source_map/source-map-cache.js n=100000 operation="findSourceMap-generated-source": 4,789,673.464011591
source_map/source-map-cache.js n=1000000 operation="findSourceMap-generated-source": 5,322,983.097883862
source_map/source-map-cache.js n=10000000 operation="findSourceMap-generated-source": 3,526,343.638308575
source_map/source-map-cache.js n=100000000 operation="findSourceMap-generated-source": 5,725,883.259174296
For source-map
source_map/source-map.js n=10 operation="parse": 24,502.29709035222
source_map/source-map.js n=100 operation="parse": 94,723.07236179667
source_map/source-map.js n=1000 operation="parse": 172,707.84309492455
source_map/source-map.js n=10000 operation="parse": 353,478.6719806294
source_map/source-map.js n=100000 operation="parse": 454,661.1017299623
source_map/source-map.js n=1000000 operation="parse": 502,081.0841701146
source_map/source-map.js n=10000000 operation="parse": 503,396.77038754406
source_map/source-map.js n=100000000 operation="parse": 500,985.0726477283
source_map/source-map.js n=10 operation="parse-sectioned": 21,158.42369743454
source_map/source-map.js n=100 operation="parse-sectioned": 28,618.788578127005
source_map/source-map.js n=1000 operation="parse-sectioned": 121,799.59387143419
source_map/source-map.js n=10000 operation="parse-sectioned": 230,234.37859741217
source_map/source-map.js n=100000 operation="parse-sectioned": 310,112.7780007161
source_map/source-map.js n=1000000 operation="parse-sectioned": 335,803.14216158056
source_map/source-map.js n=10000000 operation="parse-sectioned": 323,348.8163390162
source_map/source-map.js n=100000000 operation="parse-sectioned": 318,926.62476153404
source_map/source-map.js n=10 operation="findEntry": 167,364.01673640168
source_map/source-map.js n=100 operation="findEntry": 1,203,615.6614469867
source_map/source-map.js n=1000 operation="findEntry": 2,766,573.156493977
source_map/source-map.js n=10000 operation="findEntry": 6,595,762.22277187
source_map/source-map.js n=100000 operation="findEntry": 34,166,132.82084134
source_map/source-map.js n=1000000 operation="findEntry": 66,372,785.67112444
source_map/source-map.js n=10000000 operation="findEntry": 69,998,661.2756031
source_map/source-map.js n=100000000 operation="findEntry": 74,137,195.965463
source_map/source-map.js n=10 operation="findEntry-sectioned": 157,895.56787140985
source_map/source-map.js n=100 operation="findEntry-sectioned": 1,099,408.518217199
source_map/source-map.js n=1000 operation="findEntry-sectioned": 3,204,265.518257905
source_map/source-map.js n=10000 operation="findEntry-sectioned": 13,917,070.957577985
source_map/source-map.js n=100000 operation="findEntry-sectioned": 32,089,851.58443642
source_map/source-map.js n=1000000 operation="findEntry-sectioned": 62,772,341.727857664
source_map/source-map.js n=10000000 operation="findEntry-sectioned": 68,942,219.52581541
source_map/source-map.js n=100000000 operation="findEntry-sectioned": 66,538,906.42142866
source_map/source-map.js n=10 operation="findOrigin": 129,379.49593748382
source_map/source-map.js n=100 operation="findOrigin": 902,934.5372460497
source_map/source-map.js n=1000 operation="findOrigin": 2,388,293.540382461
source_map/source-map.js n=10000 operation="findOrigin": 12,155,586.646844957
source_map/source-map.js n=100000 operation="findOrigin": 30,224,035.664362084
source_map/source-map.js n=1000000 operation="findOrigin": 54,367,277.162258655
source_map/source-map.js n=10000000 operation="findOrigin": 61,682,814.88834895
source_map/source-map.js n=100000000 operation="findOrigin": 65,709,915.70638048
source_map/source-map.js n=10 operation="findOrigin-sectioned": 133,184.16706621918
source_map/source-map.js n=100 operation="findOrigin-sectioned": 766,530.2242867437
source_map/source-map.js n=1000 operation="findOrigin-sectioned": 2,399,042.3023129166
source_map/source-map.js n=10000 operation="findOrigin-sectioned": 5,187,171.295438972
source_map/source-map.js n=100000 operation="findOrigin-sectioned": 16,531,884.963870391
source_map/source-map.js n=1000000 operation="findOrigin-sectioned": 50,945,463.747131586
source_map/source-map.js n=10000000 operation="findOrigin-sectioned": 41,329,287.598349184
source_map/source-map.js n=100000000 operation="findOrigin-sectioned": 60,279,529.754421346
ac7a40e
to
c071304
Compare
Commit Queue failed- Loading data for nodejs/node/pull/58125 ✔ Done loading data for nodejs/node/pull/58125 ----------------------------------- PR info ------------------------------------ Title Add SourceMap Benchmark (#58125) Author Miguel Marcondes Filho <[email protected]> (@miguelmarcondesf) Branch miguelmarcondesf:performance-improvements-sourcemap -> nodejs:main Labels author ready, needs-ci, commit-queue-squash Commits 3 - benchmark: add source map and source map cache - benchmark: use fixtures for sourcemap cache - benchmark: use fixtures and avoid dead code for sourcemap Committers 1 - Miguel Marcondes <[email protected]> PR-URL: https://github.com/nodejs/node/pull/58125 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Edy Silva <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/58125 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Edy Silva <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> -------------------------------------------------------------------------------- ℹ This PR was created on Fri, 02 May 2025 17:48:50 GMT ✔ Approvals: 4 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/58125#pullrequestreview-2946108239 ✔ - Edy Silva (@geeksilva97): https://github.com/nodejs/node/pull/58125#pullrequestreview-2950130654 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/58125#pullrequestreview-2952013937 ✔ - Rafael Gonzaga (@RafaelGSS) (TSC): https://github.com/nodejs/node/pull/58125#pullrequestreview-2975274650 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2025-06-23T13:44:33Z: https://ci.nodejs.org/job/node-test-pull-request/67620/ ⚠ Commits were pushed after the last Full PR CI run: ⚠ - benchmark: add source map and source map cache ⚠ - benchmark: use fixtures for sourcemap cache ⚠ - benchmark: use fixtures and avoid dead code for sourcemap - Querying data for job/node-test-pull-request/67620/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/15999945215 |
Add SourceMap Benchmark
This PR introduces a new benchmark suite for the
lib/internal/source_map
module to help evaluate and explore the performance characteristics of theSourceMap
.I'm still learning how everything fits together, but this is a first step toward understanding where small improvements could improve performance.
cc @BridgeAR