Skip to content

Batch allocations of common checker types - #64776

Merged
Jake Bailey (jakebailey) merged 0 commit into
jakebailey/mem/compressed-link-storesfrom
jakebailey/mem/batched-type-allocs
Oct 13, 2026
Merged

Jake Bailey (jakebailey) merged 0 commit into
jakebailey/mem/compressed-link-storesfrom
jakebailey/mem/batched-type-allocs

Conversation

@jakebailey

@jakebailey Jake Bailey (jakebailey) commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Common type representations create many small heap objects during checking.

  • Uses the existing typed arenas for frequently allocated type records, reducing small-object allocation overhead.
  • Blocks remain independently collectible rather than giving every type the lifetime of the entire checker.

Part of the memory optimization stack summarized in #64734.

@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 13, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to stack #64792 October 13, 2026 17:37
@jakebailey Jake Bailey (jakebailey) changed the title Batch allocations of common checker types Batch allocations of common checker types Common type representations create many small heap objects during checking. - Uses the existing typed arenas for frequently allocated type records, reducing small-object allocation overhead. - Blocks remain independently collectible rather than giving every type the lifetime of the entire checker. Oct 13, 2026
@jakebailey Jake Bailey (jakebailey) changed the title Batch allocations of common checker types Common type representations create many small heap objects during checking. - Uses the existing typed arenas for frequently allocated type records, reducing small-object allocation overhead. - Blocks remain independently collectible rather than giving every type the lifetime of the entire checker. Batch allocations of common checker types Oct 13, 2026
@jakebailey
Jake Bailey (jakebailey) marked this pull request as ready for review October 13, 2026 17:42
Copilot AI balanced review requested due to automatic review settings October 13, 2026 17:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The mechanical allocation changes preserve type initialization and lifetime semantics without identified correctness issues.

0 open findings

What changed in this PR

This PR reduces checker allocation overhead by using typed arenas for common type records.

Changes:

  • Adds ten type-specific arenas to Checker.
  • Routes common type constructors through arena allocation.
File Description
tsc/​internal/​checker/​checker.go Adds and uses arenas for frequently allocated checker types.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@jakebailey
Jake Bailey (jakebailey) force-pushed the jakebailey/mem/batched-type-allocs branch from 49e3c55 to 6ae11db Compare October 13, 2026 20:06
@jakebailey
Jake Bailey (jakebailey) deleted the jakebailey/mem/batched-type-allocs branch October 13, 2026 20:06
@jakebailey
Jake Bailey (jakebailey) restored the jakebailey/mem/batched-type-allocs branch October 13, 2026 20:14
@jakebailey
Jake Bailey (jakebailey) deleted the jakebailey/mem/batched-type-allocs branch October 14, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants