Repository navigation
Conversation
Profiling a large TypeScript build retains a source map consumer for every map found at startup. A capture usually needs maps for only a fraction of the scripts. Resolve the sampled positions after capture and release each consumer before decoding another map. A bounded cache keeps resolved positions for later captures. A Node 24.20 replay used 38,670 maps and sampled 128 scripts. Startup CPU fell from 20.9 seconds to under 1 ms. Retained JS heap fell from 1,727 MiB to 0.9 MiB, with identical pprof bytes. Refs: #445
Overall package sizeSelf size: 3.15 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | pprof-format | 2.4.1 | 924.37 kB | 924.37 kB | | source-map | 0.8.0 | 185.66 kB | 185.66 kB | | node-gyp-build | 4.8.4 | 13.86 kB | 13.86 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
One unmapped frame can make the first export read and parse every map under the application root. Limit discovery to the sampled script's annotation and adjacent sidecar. Cache definitive misses for the mapper's lifetime. Large maps can stall the application thread during decoding even when reads are asynchronous. Run large lookups on a worker and let overlapping captures reuse completed lookups. Clear the worker's Node options to keep application preloads from holding it open. V8 reports encoded file URLs for ESM scripts, and compilers encode paths in annotations. Convert those URLs before filesystem lookups. Refs: #445 PR-URL: #453
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 2 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: baa6e4a | Docs | View more details | Give us feedback! |
This branch has not been deployed
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.
Profiling a large TypeScript build retains a source map consumer for every map
found at startup. A capture usually needs maps for only a fraction of the scripts.
Resolve the sampled positions after capture and release each consumer before
decoding another map. A bounded cache keeps resolved positions for later captures.
A Node 24.20 replay used 38,670 maps and sampled 128 scripts. Startup CPU fell from
20.9 seconds to under 1 ms. Retained JS heap fell from 1,727 MiB to 0.9 MiB, with
identical pprof bytes.
Refs: #445