Repository navigation
Commit a2bedd7
committed
Use paged indexes for type-node and signature caches
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)1 parent f2c6548 commit a2bedd7
2 files changed
Lines changed: 34 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
698 | | - | |
| 698 | + | |
699 | 699 | | |
700 | | - | |
| 700 | + | |
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
18 | 50 | | |
19 | 51 | | |
20 | 52 | | |
| |||
0 commit comments