Repository navigation
Batch allocations of common checker types - #64793
Merged
Jake Bailey (jakebailey) merged 1 commit intoOct 14, 2026
Merged
Jake Bailey (jakebailey) merged 1 commit into
Jake Bailey (jakebailey) merged 1 commit into
Conversation
Common type representations create many small heap objects during checking, adding allocator and GC bookkeeping costs. Use the existing bounded typed arenas for frequently allocated types. Unlike an arena that owns the entire graph, old blocks can still be reclaimed when no live type references them.
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 allocation changes are localized and preserve type initialization, tagging, and block-level lifetime behavior.
0 open findings
What changed in this PR
Moves frequently allocated checker type records into typed arenas, reducing heap allocation overhead while preserving existing type construction behavior.
Changes:
- Adds arenas for ten common checker type representations.
- Routes corresponding constructors through arena allocation.
| File | Description |
|---|---|
tsc/internal/checker/checker.go |
Adds typed arenas and uses them for common type allocations. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Anders Hejlsberg (ahejlsberg)
approved these changes
Oct 13, 2026
Jake Bailey (jakebailey)
deleted the
jakebailey/mem/batched-type-allocs
branch
October 14, 2026 01:07
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.
Common type representations create many small heap objects during checking.
Part of the memory optimization stack summarized in #64734.
Replaces #64776, which GitHub closed as merged when the stack was reordered.