Repository navigation
Commit ec7b1ea
committed
Keep optional outer type parameters out of hot node links
Most resolved type nodes never need an anonymous object's outer type
parameter list. Reserving a slice header for every node makes the common
case needlessly expensive to retain and scan.
TypeNodeLinks now occupies 16 rather than 32 bytes on amd64. An optional
checker-owned arena entry preserves computed-empty lists and the
original slice aliasing without introducing a separate allocation per
cached list.
VS Code src/tsconfig.json versus the parent commit, six fresh-process
interleaved pairs with the normal GC policy. Retained bytes fall 0.43%,
scan bytes 0.47%, and allocated bytes 0.33%. Allocation events and
instruction counts are not statistically different; no CPU improvement
is claimed.
Exact production diagnostics and semantic counts match.
goos: linux
goarch: amd64
pkg: github.com/microsoft/TypeScript/tsc/internal/checker
cpu: Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz
│ vscode-typeparams-before.txt │ vscode-typeparams.txt │
│ retained-B │ retained-B vs base │
ExternalProgram-20 3.864Gi ± 0% 3.847Gi ± 0% -0.43% (p=0.002 n=6)
│ vscode-typeparams-before.txt │ vscode-typeparams.txt │
│ scan-B │ scan-B vs base │
ExternalProgram-20 3.459Gi ± 0% 3.443Gi ± 0% -0.47% (p=0.002 n=6)
│ vscode-typeparams-before.txt │ vscode-typeparams.txt │
│ B/op │ B/op vs base │
ExternalProgram-20 5.484Gi ± 0% 5.466Gi ± 0% -0.33% (p=0.002 n=6)
│ vscode-typeparams-before.txt │ vscode-typeparams.txt │
│ allocs/op │ allocs/op vs base │
ExternalProgram-20 27.38M ± 0% 27.35M ± 0% ~ (p=0.093 n=6)
│ typeparams-before-instructions.txt │ typeparams-instructions.txt │
│ instructions/op │ instructions/op vs base │
ExternalInstructions-20 297.2G ± 2% 290.9G ± 4% ~ (p=0.310 n=6)1 parent de1ff36 commit ec7b1ea
3 files changed
Lines changed: 55 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
| 689 | + | |
689 | 690 | | |
690 | 691 | | |
691 | 692 | | |
| |||
22870 | 22871 | | |
22871 | 22872 | | |
22872 | 22873 | | |
22873 | | - | |
| 22874 | + | |
22874 | 22875 | | |
22875 | 22876 | | |
22876 | 22877 | | |
| |||
22893 | 22894 | | |
22894 | 22895 | | |
22895 | 22896 | | |
22896 | | - | |
| 22897 | + | |
22897 | 22898 | | |
22898 | 22899 | | |
22899 | 22900 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
441 | | - | |
442 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
443 | 461 | | |
444 | 462 | | |
445 | 463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
0 commit comments