Repository navigation
Use paged indexes for type-node and signature caches - #64803
Merged
Jake Bailey (jakebailey) merged 1 commit intoOct 14, 2026
Conversation
Jake Bailey (jakebailey)
added this pull request to stack #64805
October 13, 2026 20:16
Jake Bailey (jakebailey)
removed this pull request from stack #64805
October 13, 2026 20:49
Jake Bailey (jakebailey)
added this pull request to stack #64806
October 13, 2026 20:50
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused cache migration preserves behavior and has comprehensive targeted coverage.
0 open findings
What changed in this PR
Migrates checker type-node and signature caches to paged node-ID storage, reducing memory overhead.
Changes:
- Replaces pointer-keyed caches with
nodeLinkStore. - Adds coverage for fallback IDs, checker isolation, GC, and cloned nodes.
| File | Description |
|---|---|
tsc/internal/checker/checker.go |
Migrates two checker caches to paged storage. |
tsc/internal/checker/types_test.go |
Verifies cache correctness and isolation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Jake Bailey (jakebailey)
force-pushed
the
jakebailey/mem/indexed-type-node-caches
branch
from
October 13, 2026 21:39
e46e706 to
7517855
Compare
Jake Bailey (jakebailey)
force-pushed
the
jakebailey/mem/indexed-type-node-caches
branch
2 times, most recently
from
October 14, 2026 02:23
2565d17 to
a2bedd7
Compare
Anders Hejlsberg (ahejlsberg)
force-pushed
the
jakebailey/mem/indexed-type-node-caches
branch
from
October 14, 2026 14:14
a2bedd7 to
5b0147e
Compare
Resolved type nodes and signatures still kept AST pointers as map keys
despite already having stable node identities. Those maps add redundant
pointer storage, GC scanning, hashing, and growth allocations.
Reuse the existing node-link store's pointer-free paged indexes for
these two high-volume caches. Ordinary IDs and IDs outside the dense
reserved range retain the existing fallback, and caches stay
checker-local.
Six fresh-process interleaved VS Code comparisons against the parent
commit, using normal GC, reduce retained heap 1.20%, scan bytes 2.12%,
allocated bytes 2.11%, and allocation events 0.20%. Instructions are
inconclusive. This saves another roughly 43 MiB of heap and 66 MiB of
scanning.
Production diagnostics and semantic counts match exactly. Tests cover
cache identity, ordinary/reserved IDs, clone isolation, growth,
GC reachability, and independent checkers.
goos: linux
goarch: amd64
pkg: github.com/microsoft/TypeScript/tsc/internal/checker
cpu: Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz
│ vscode-paged-before-6.txt │ vscode-paged-6.txt │
│ retained-B │ retained-B vs base │
ExternalProgram-20 3.497Gi ± 0% 3.455Gi ± 0% -1.20% (p=0.002 n=6)
│ vscode-paged-before-6.txt │ vscode-paged-6.txt │
│ scan-B │ scan-B vs base │
ExternalProgram-20 3.061Gi ± 0% 2.997Gi ± 0% -2.12% (p=0.002 n=6)
│ vscode-paged-before-6.txt │ vscode-paged-6.txt │
│ B/op │ B/op vs base │
ExternalProgram-20 5.129Gi ± 0% 5.021Gi ± 0% -2.11% (p=0.002 n=6)
│ vscode-paged-before-6.txt │ vscode-paged-6.txt │
│ allocs/op │ allocs/op vs base │
ExternalProgram-20 31.16M ± 0% 31.09M ± 0% -0.20% (p=0.002 n=6)
│ paged-before-instructions.txt │ paged-instructions.txt │
│ instructions/op │ instructions/op vs base │
ExternalInstructions-20 279.8G ± 5% 270.5G ± 2% ~ (p=0.589 n=6)
Jake Bailey (jakebailey)
force-pushed
the
jakebailey/mem/indexed-type-node-caches
branch
from
October 14, 2026 14:17
5b0147e to
1ac816f
Compare
Anders Hejlsberg (ahejlsberg)
approved these changes
Oct 14, 2026
Jake Bailey (jakebailey)
deleted the
jakebailey/mem/indexed-type-node-caches
branch
October 14, 2026 16:02
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.
Resolved type nodes and signatures were cached in maps keyed by AST pointer, despite nodes already having stable IDs.
Part of the memory optimization stack summarized in #64734.
Replaces #64787, which GitHub closed as merged when the stack was reordered.