Skip to content

Pre-size member, export, and locals symbol tables - #65025

Draft
Jake Bailey (jakebailey) wants to merge 3 commits into
microsoft:mainfrom
jakebailey:perf/presized-symbol-tables
Draft

Jake Bailey (jakebailey) wants to merge 3 commits into
microsoft:mainfrom
jakebailey:perf/presized-symbol-tables

Conversation

@jakebailey

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

Copy link
Copy Markdown
Member

Symbol tables created on demand by GetMembers, GetExports, and GetLocals always started empty, so binding a class, interface, enum, object literal, namespace, or source file grew the entry slice repeatedly and, once past the linear-search limit, built the hash index and rebuilt it again as it filled up.

The declaration that owns the table already tells us roughly how many entries it will receive: the number of class/interface/type literal members, object literal properties, enum members, top-level statements, or parameters and type parameters. Use that count as a capacity hint when the table is first created so it is usually allocated once at the right size. The hint only affects allocation; insertion order, and therefore iteration order, is unchanged.

Thanks Steven (@teamchong) for finding this!

Symbol tables created on demand by GetMembers, GetExports, and GetLocals
always started empty, so binding a class, interface, enum, object
literal, namespace, or source file grew the entry slice repeatedly and,
once past the linear-search limit, built the hash index and rebuilt it
again as it filled up.

The declaration that owns the table already tells us roughly how many
entries it will receive: the number of class/interface/type literal
members, object literal properties, enum members, top-level statements,
or parameters and type parameters. Use that count as a capacity hint
when the table is first created so it is usually allocated once at the
right size. The hint only affects allocation; insertion order, and
therefore iteration order, is unchanged.

Co-authored-by: Steven Chong <25894545+teamchong@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 20:18
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Oct 29, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 29, 2026
@jakebailey

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) perf test this faster

@typescript-automation

typescript-automation Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
perf test this faster ✅ Started 👀 Results

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.

🟡 Changes recommended

The capacity hints count all statements rather than export-producing declarations, causing excessive memory allocation and unnecessary hashed lookups in modules with few exports.

1 open issue
What changed in this PR

This PR pre-sizes lazily created symbol tables in the native TypeScript compiler using declaration syntax, aiming to reduce allocations during binding without changing insertion order.

Changes:

  • Initialize members, exports, and locals tables with capacity hints.
  • Estimate capacity from member, property, statement, parameter, and type-parameter counts.
File Description
tsc/​internal/​ast/​utilities.go Adds capacity estimators and uses them when initializing symbol tables.

Review effort: Balanced

Comment thread tsc/internal/ast/utilities.go Resolved
The capacity hints for source file and namespace symbol tables used the
number of top-level statements. That badly overshoots whenever most
statements declare nothing that lands in the table: a module with many
private declarations and a single export reserved an entry slot, and
past the linear-search limit a hash index, for every statement in its
exports table, and expression-heavy scripts did the same for locals.
Besides the wasted memory, a hint above the linear-search limit forces
hashed lookups on a table that ends up tiny.

Instead, count what the binder will actually declare, in a single pass
over the statements without allocating. Exports count declarations with
an export modifier (or every declaration in an ambient export context),
export specifiers, `export * as ns`, export assignments, and one shared
entry for any number of plain `export *` declarations. Locals count
declarations (one per variable declarator), import bindings, and
non-exported import aliases, leaving out unnamed default exports and
exported import aliases, which only produce exports.

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.

🔵 Needs a closer look

The class instance-member hint incorrectly counts static elements, causing oversized slice and hash-index allocations for classes with few instance members.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Exclude static elements from class instance-member hint

tsc/​internal/​ast/​utilities.go:137

The class member hint counts static elements, but declareClassMember puts static members in exports, not members. A class with many static members and one constructor therefore reserves a large entry slice and hash index for an instance table containing only the constructor. Exclude static elements, including static blocks, from the class instance-member hint using IsStatic.

1 resolved since last review

Review effort: Balanced

@jakebailey Jake Bailey (jakebailey) added the Domain: Performance Reports of unusually slow behavior label Oct 29, 2026
The class members hint counted every class element, but the binder
declares static elements in the class's exports rather than its
members, and static blocks and stray semicolons declare nothing. A class
made up mostly of static members therefore reserved a large entry slice,
and past the linear-search limit a hash index, for an instance member
table that might hold only a constructor, while its exports table still
started empty and grew one entry at a time.

Count the class elements once and attribute each to the table it lands
in: instance elements, a single constructor entry shared by all of its
overloads, and constructor parameter properties go to members; static
elements plus the implicit `prototype` property go to exports.
Overloaded methods and accessor pairs may still be counted more than
once, which keeps the hint within a small constant factor of the
actual size.
@typescript-automation

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - native
Errors 41 41 ~ ~ ~ p=1.000 n=20
Symbols 88,466 88,466 ~ ~ ~ p=1.000 n=20
Types 79,607 79,607 ~ ~ ~ p=1.000 n=20
Memory Used 104,134k (± 0.03%) 104,106k (± 0.02%) ~ 104,033k 104,222k p=0.087 n=20
Memory Allocs 1,263,820 (± 0.01%) 1,261,747 (± 0.01%) -2,073 (- 0.16%) 1,261,380 1,262,090 p=0.000 n=20
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Parse Time 0.023s (± 2.68%) 0.023s (± 2.71%) ~ 0.020s 0.025s p=0.967 n=20
Bind Time 0.008s (± 5.51%) 0.008s (± 5.47%) ~ 0.007s 0.010s p=0.235 n=20
Check Time 0.212s (± 0.72%) 0.214s (± 0.79%) ~ 0.206s 0.221s p=0.052 n=20
Emit Time 0.137s (± 0.72%) 0.136s (± 0.94%) ~ 0.131s 0.141s p=0.404 n=20
Total Time 0.383s (± 0.36%) 0.384s (± 0.49%) ~ 0.373s 0.393s p=0.211 n=20
angular-1 - native
Errors 3 3 ~ ~ ~ p=1.000 n=20
Symbols 586,509 (± 0.02%) 586,515 (± 0.01%) ~ 586,177 586,887 p=0.779 n=20
Types 241,688 (± 0.00%) 241,688 (± 0.00%) ~ 241,685 241,697 p=0.780 n=20
Memory Used 517,954k (± 0.02%) 517,853k (± 0.01%) ~ 517,576k 518,207k p=0.114 n=20
Memory Allocs 7,799,312 (± 0.14%) 7,764,555 (± 0.08%) -34,757 (- 0.45%) 7,754,770 7,801,240 p=0.000 n=20
Config Time 0.009s 0.009s ~ ~ ~ p=1.000 n=20
Parse Time 0.126s (± 2.61%) 0.127s (± 3.76%) ~ 0.115s 0.156s p=0.952 n=20
Bind Time 0.043s (±10.45%) 0.042s (± 8.75%) ~ 0.038s 0.065s p=0.141 n=20
Check Time 0s 0s ~ ~ ~ p=1.000 n=20
Emit Time 0.850s (± 1.07%) 0.849s (± 1.07%) ~ 0.827s 0.908s p=0.825 n=20
Total Time 1.038s (± 1.10%) 1.036s (± 1.15%) ~ 1.009s 1.107s p=0.713 n=20
arktype - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 685,920 685,920 ~ ~ ~ p=1.000 n=20
Types 939,467 939,467 ~ ~ ~ p=1.000 n=20
Memory Used 497,298k (± 0.01%) 497,256k (± 0.01%) ~ 496,985k 497,447k p=0.274 n=20
Memory Allocs 12,108,970 (± 0.02%) 12,095,724 (± 0.01%) -13,247 (- 0.11%) 12,091,592 12,101,756 p=0.000 n=20
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=20
Parse Time 0.041s (± 2.72%) 0.041s (± 2.78%) ~ 0.038s 0.046s p=0.701 n=20
Bind Time 0.013s (±10.64%) 0.012s (± 7.50%) ~ 0.011s 0.019s p=0.079 n=20
Check Time 0.986s (± 0.86%) 1.000s (± 1.10%) +0.014s (+ 1.39%) 0.962s 1.057s p=0.029 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 1.071s (± 0.70%) 1.083s (± 0.98%) +0.012s (+ 1.12%) 1.050s 1.140s p=0.048 n=20
class-transformer - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 45,376 45,376 ~ ~ ~ p=1.000 n=20
Types 7,573 7,573 ~ ~ ~ p=1.000 n=20
Memory Used 27,838k (± 0.01%) 27,825k (± 0.01%) -13k (- 0.05%) 27,809k 27,850k p=0.000 n=20
Memory Allocs 248,534 (± 0.05%) 244,454 (± 0.05%) -4,080 (- 1.64%) 244,001 244,917 p=0.000 n=20
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Parse Time 0.012s (± 2.77%) 0.011s (± 5.13%) ~ 0.008s 0.012s p=0.546 n=20
Bind Time 0.003s (±11.29%) 0.004s (±11.02%) ~ 0.002s 0.005s p=0.201 n=20
Check Time 0.008s (± 4.78%) 0.008s (± 5.20%) ~ 0.007s 0.010s p=0.431 n=20
Emit Time 0.009s (± 6.78%) 0.009s (± 5.10%) ~ 0.007s 0.010s p=0.922 n=20
Total Time 0.032s (± 1.93%) 0.032s (± 2.72%) ~ 0.028s 0.036s p=0.430 n=20
effect - native
Errors 12 12 ~ ~ ~ p=1.000 n=20
Symbols 1,235,115 1,235,115 ~ ~ ~ p=1.000 n=20
Types 894,113 894,113 ~ ~ ~ p=1.000 n=20
Memory Used 940,498k (± 0.02%) 940,882k (± 0.02%) +384k (+ 0.04%) 940,108k 941,841k p=0.005 n=20
Memory Allocs 12,670,876 (± 0.02%) 12,620,149 (± 0.03%) -50,728 (- 0.40%) 12,609,096 12,644,576 p=0.000 n=20
Config Time 0.002s (± 5.09%) 0.002s ~ ~ ~ p=1.000 n=20
Parse Time 0.152s (± 2.41%) 0.153s (± 1.78%) ~ 0.142s 0.166s p=0.533 n=20
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Check Time 0.967s (± 1.04%) 0.980s (± 1.50%) ~ 0.922s 1.074s p=0.213 n=20
Emit Time 0.516s (± 2.01%) 0.522s (± 2.91%) ~ 0.470s 0.592s p=0.625 n=20
Total Time 1.738s (± 0.84%) 1.750s (± 1.02%) ~ 1.675s 1.823s p=0.324 n=20
mui-docs - native
Errors 11,405 11,405 ~ ~ ~ p=1.000 n=20
Symbols 3,784,019 3,784,019 ~ ~ ~ p=1.000 n=20
Types 1,355,974 1,355,974 ~ ~ ~ p=1.000 n=20
Memory Used 1,837,729k (± 0.07%) 1,838,043k (± 0.07%) ~ 1,832,881k 1,844,493k p=0.989 n=20
Memory Allocs 26,024,298 (± 0.16%) 25,970,866 (± 0.15%) -53,432 (- 0.21%) 25,857,272 26,190,162 p=0.033 n=20
Config Time 0.008s (± 1.77%) 0.008s ~ ~ ~ p=0.487 n=20
Parse Time 0.301s (± 2.26%) 0.302s (± 2.49%) ~ 0.271s 0.330s p=0.941 n=20
Bind Time 0.001s 0.001s ~ ~ ~ p=1.000 n=20
Check Time 3.060s (± 0.44%) 3.071s (± 0.50%) ~ 3.012s 3.115s p=0.317 n=20
Emit Time 0.238s (± 0.93%) 0.239s (± 1.20%) ~ 0.229s 0.249s p=0.498 n=20
Total Time 4.095s (± 0.36%) 4.109s (± 0.41%) ~ 4.051s 4.174s p=0.163 n=20
sentry - native
Errors 2 2 ~ ~ ~ p=1.000 n=20
Symbols 4,793,245 4,793,245 ~ ~ ~ p=1.000 n=20
Types 2,607,045 2,607,045 ~ ~ ~ p=1.000 n=20
Memory Used 2,881,285k (± 0.04%) 2,881,130k (± 0.03%) ~ 2,878,957k 2,885,245k p=0.904 n=20
Memory Allocs 75,736,179 (± 0.82%) 75,174,812 (± 0.23%) ~ 74,633,077 76,289,170 p=0.102 n=20
Config Time 0.026s (± 0.88%) 0.026s (± 1.10%) ~ 0.025s 0.027s p=0.085 n=20
Parse Time 0.499s (± 4.58%) 0.497s (± 5.83%) ~ 0.439s 0.697s p=0.763 n=20
Bind Time 0.175s (±11.70%) 0.171s (±10.39%) ~ 0.136s 0.236s p=0.490 n=20
Check Time 6.794s (± 0.70%) 6.821s (± 0.77%) ~ 6.673s 7.036s p=0.512 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 7.546s (± 0.58%) 7.569s (± 0.80%) ~ 7.420s 7.883s p=0.878 n=20
social-app - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 1,883,074 1,883,074 ~ ~ ~ p=1.000 n=20
Types 1,158,168 1,158,168 ~ ~ ~ p=1.000 n=20
Memory Used 972,531k (± 0.01%) 972,809k (± 0.02%) +278k (+ 0.03%) 971,910k 973,511k p=0.018 n=20
Memory Allocs 13,579,132 (± 0.16%) 13,548,298 (± 0.27%) -30,834 (- 0.23%) 13,482,267 13,811,492 p=0.006 n=20
Config Time 0.008s (± 1.30%) 0.008s (± 1.30%) ~ 0.008s 0.009s p=1.000 n=20
Parse Time 0.166s (± 2.04%) 0.168s (± 2.60%) ~ 0.147s 0.187s p=0.432 n=20
Bind Time 0.047s (± 8.78%) 0.045s (± 9.22%) ~ 0.039s 0.066s p=0.143 n=20
Check Time 1.525s (± 0.70%) 1.518s (± 0.59%) ~ 1.479s 1.542s p=0.324 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 1.766s (± 0.58%) 1.758s (± 0.56%) ~ 1.720s 1.817s p=0.103 n=20
strada-build-src - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 1,184,972 1,184,972 ~ ~ ~ p=1.000 n=20
Types 438,963 438,963 ~ ~ ~ p=1.000 n=20
Memory Used 1,168,555k (± 0.20%) 1,174,730k (± 0.65%) ~ 1,159,528k 1,220,768k p=0.841 n=20
Memory Allocs 47,753,816 (± 0.08%) 47,571,178 (± 0.12%) -182,638 (- 0.38%) 47,374,273 47,785,520 p=0.000 n=20
Config Time 0.002s (±18.03%) 0.002s (±18.87%) ~ 0.000s 0.002s p=0.242 n=20
Parse Time 0.146s (± 2.50%) 0.146s (± 2.17%) ~ 0.134s 0.166s p=0.888 n=20
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Check Time 0.845s (± 1.40%) 0.845s (± 1.48%) ~ 0.814s 0.894s p=0.867 n=20
Emit Time 0.148s (± 2.30%) 0.151s (± 3.48%) ~ 0.139s 0.178s p=0.605 n=20
Total Time 9.867s (± 1.76%) 9.903s (± 1.52%) ~ 9.474s 10.526s p=0.583 n=20
strada-compiler - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 263,511 263,511 ~ ~ ~ p=1.000 n=20
Types 196,116 196,116 ~ ~ ~ p=1.000 n=20
Memory Used 224,643k (± 0.02%) 224,552k (± 0.03%) -91k (- 0.04%) 224,247k 224,751k p=0.044 n=20
Memory Allocs 2,401,453 (± 0.01%) 2,392,419 (± 0.01%) -9,033 (- 0.38%) 2,391,161 2,393,797 p=0.000 n=20
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Parse Time 0.049s (± 3.23%) 0.052s (± 3.39%) 🔻+0.003s (+ 7.05%) 0.044s 0.060s p=0.006 n=20
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Check Time 0.374s (± 0.67%) 0.376s (± 0.65%) ~ 0.369s 0.388s p=0.120 n=20
Emit Time 0.048s (± 4.97%) 0.048s (± 4.09%) ~ 0.042s 0.054s p=0.995 n=20
Total Time 0.499s (± 0.76%) 0.504s (± 0.64%) +0.005s (+ 0.97%) 0.492s 0.514s p=0.048 n=20
t3code-server - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 4,350,661 4,350,661 ~ ~ ~ p=1.000 n=20
Types 3,040,644 3,040,644 ~ ~ ~ p=1.000 n=20
Memory Used 2,433,177k (± 0.02%) 2,433,369k (± 0.02%) ~ 2,431,332k 2,435,734k p=0.410 n=20
Memory Allocs 37,412,645 (± 0.13%) 37,273,073 (± 0.10%) -139,572 (- 0.37%) 37,172,488 37,497,586 p=0.000 n=20
Config Time 0.003s 0.003s ~ ~ ~ p=1.000 n=20
Parse Time 0.255s (± 2.61%) 0.251s (± 3.20%) ~ 0.227s 0.289s p=0.351 n=20
Bind Time 0.085s (± 8.82%) 0.096s (±12.25%) ~ 0.071s 0.143s p=0.605 n=20
Check Time 7.182s (± 0.58%) 7.173s (± 0.83%) ~ 7.065s 7.614s p=0.324 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 7.536s (± 0.53%) 7.534s (± 0.86%) ~ 7.402s 8.002s p=0.551 n=20
tanstack-router - native
Errors 1 1 ~ ~ ~ p=1.000 n=20
Symbols 571,756 571,756 ~ ~ ~ p=1.000 n=20
Types 397,689 397,689 ~ ~ ~ p=1.000 n=20
Memory Used 331,455k (± 0.01%) 331,330k (± 0.02%) -125k (- 0.04%) 331,066k 331,612k p=0.000 n=20
Memory Allocs 4,392,691 (± 0.16%) 4,373,150 (± 0.13%) -19,542 (- 0.44%) 4,361,842 4,399,697 p=0.000 n=20
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=20
Parse Time 0.038s (± 3.35%) 0.039s (± 4.74%) ~ 0.032s 0.045s p=0.170 n=20
Bind Time 0.012s (± 8.01%) 0.012s (± 8.98%) 🟩-0.001s (- 6.83%) 0.010s 0.018s p=0.044 n=20
Check Time 0.558s (± 0.79%) 0.560s (± 1.07%) ~ 0.543s 0.589s p=0.733 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 0.627s (± 0.62%) 0.631s (± 1.01%) ~ 0.611s 0.653s p=0.515 n=20
ts-pre-modules - native
Errors 87 87 ~ ~ ~ p=1.000 n=20
Symbols 231,616 231,616 ~ ~ ~ p=1.000 n=20
Types 181,195 181,195 ~ ~ ~ p=1.000 n=20
Memory Used 193,517k (± 0.01%) 193,468k (± 0.01%) -49k (- 0.03%) 193,373k 193,560k p=0.003 n=20
Memory Allocs 1,318,305 (± 0.02%) 1,311,031 (± 0.03%) -7,274 (- 0.55%) 1,310,263 1,313,612 p=0.000 n=20
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Parse Time 0.043s (± 3.80%) 0.042s (± 2.48%) ~ 0.038s 0.046s p=0.461 n=20
Bind Time 0.020s (± 4.98%) 0.022s (± 4.81%) 🔻+0.002s (+ 8.79%) 0.018s 0.026s p=0.017 n=20
Check Time 0.302s (± 1.09%) 0.301s (± 1.17%) ~ 0.287s 0.313s p=0.541 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 0.372s (± 0.82%) 0.371s (± 0.88%) ~ 0.354s 0.381s p=0.846 n=20
vscode - native
Errors 11 11 ~ ~ ~ p=1.000 n=20
Symbols 7,501,886 7,501,886 ~ ~ ~ p=1.000 n=20
Types 4,415,089 4,415,089 ~ ~ ~ p=1.000 n=20
Memory Used 5,203,879k (± 0.01%) 5,204,395k (± 0.01%) ~ 5,202,170k 5,206,725k p=0.265 n=20
Memory Allocs 56,949,900 (± 0.02%) 56,658,299 (± 0.02%) -291,601 (- 0.51%) 56,629,107 56,712,854 p=0.000 n=20
Config Time 0.035s (± 0.67%) 0.035s (± 0.90%) ~ 0.035s 0.037s p=0.514 n=20
Parse Time 0.909s (± 1.25%) 0.890s (± 2.09%) ~ 0.814s 0.939s p=0.365 n=20
Bind Time 0.305s (± 4.06%) 0.340s (±11.84%) ~ 0.282s 0.529s p=0.473 n=20
Check Time 7.759s (± 0.38%) 7.733s (± 0.76%) ~ 7.502s 7.922s p=0.973 n=20
Emit Time 2.709s (± 4.08%) 2.925s (± 6.36%) 🔻+0.216s (+ 7.97%) 2.610s 3.596s p=0.008 n=20
Total Time 11.775s (± 0.91%) 11.982s (± 1.32%) +0.207s (+ 1.76%) 11.665s 12.611s p=0.008 n=20
webpack - native
Errors 616 616 ~ ~ ~ p=1.000 n=20
Symbols 917,188 917,188 ~ ~ ~ p=1.000 n=20
Types 636,859 636,859 ~ ~ ~ p=1.000 n=20
Memory Used 693,477k (± 0.02%) 693,458k (± 0.02%) ~ 693,016k 694,164k p=0.826 n=20
Memory Allocs 6,498,345 (± 0.03%) 6,468,767 (± 0.09%) -29,578 (- 0.46%) 6,456,337 6,512,338 p=0.000 n=20
Config Time 0.004s 0.004s (±16.78%) ~ 0.004s 0.011s p=1.000 n=20
Parse Time 0.140s (± 3.00%) 0.141s (± 3.65%) ~ 0.121s 0.171s p=0.973 n=20
Bind Time 0.044s (± 7.40%) 0.049s (±11.99%) ~ 0.038s 0.077s p=0.711 n=20
Check Time 1.159s (± 0.91%) 1.176s (± 1.40%) ~ 1.117s 1.252s p=0.082 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 1.370s (± 0.85%) 1.397s (± 0.97%) +0.027s (+ 1.96%) 1.349s 1.467s p=0.005 n=20
xstate-main - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 640,490 640,490 ~ ~ ~ p=1.000 n=20
Types 387,984 387,984 ~ ~ ~ p=1.000 n=20
Memory Used 350,927k (± 0.02%) 350,762k (± 0.02%) -165k (- 0.05%) 350,623k 351,142k p=0.000 n=20
Memory Allocs 3,991,786 (± 0.07%) 3,967,947 (± 0.08%) -23,839 (- 0.60%) 3,957,316 3,982,121 p=0.000 n=20
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=20
Parse Time 0.062s (± 3.76%) 0.060s (± 2.31%) ~ 0.054s 0.065s p=0.196 n=20
Bind Time 0.021s (±10.85%) 0.021s (±12.04%) ~ 0.017s 0.033s p=0.177 n=20
Check Time 0.417s (± 1.15%) 0.414s (± 0.69%) ~ 0.404s 0.425s p=0.261 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 0.506s (± 1.08%) 0.500s (± 0.82%) ~ 0.484s 0.515s p=0.095 n=20
System info unknown
Hosts
  • native
Scenarios
  • Compiler-Unions - native
  • angular-1 - native
  • arktype - native
  • class-transformer - native
  • effect - native
  • mui-docs - native
  • sentry - native
  • social-app - native
  • strada-build-src - native
  • strada-compiler - native
  • t3code-server - native
  • tanstack-router - native
  • ts-pre-modules - native
  • vscode - native
  • webpack - native
  • xstate-main - native
Benchmark Name Iterations
Current pr 20
Baseline baseline 20

Developer Information:

Download Benchmarks

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.

🟡 Changes recommended

Declaration-backed symbol-table initialization lacks focused regression tests verifying that predicted-capacity fills avoid further backing-store allocation and retain insertion order, including above the 16-entry hash-index threshold.

1 open issue

Review effort: Balanced

return GetSymbolTable(&symbol.ensureExtra(arena).members)
extra := symbol.ensureExtra(arena)
if extra.members == nil {
extra.members = NewSymbolTableWithCapacity(membersCapacityHint(symbol))

Copilot AI commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Run {

Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review.

Note

You can configure setup steps for Copilot code review separately from Copilot cloud agent with a copilot-code-review.yml file. Read the docs for details.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed at 8a39fac. The revised hints distinguish private exports and static versus instance class members, and affect capacity without changing symbol insertion order or growth correctness. AST tests and targeted ambient-module, default-export, namespace-merging, and export-star compiler baselines passed. No concrete correctness regression found.

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Oct 30, 2026
@jakebailey

Copy link
Copy Markdown
Member Author

This does not feel super worth it based on the benchmarks and the amount of code

@jakebailey
Jake Bailey (jakebailey) marked this pull request as draft October 30, 2026 18:58

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team Domain: Performance Reports of unusually slow behavior For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Needs merge

Development

Successfully merging this pull request may close these issues.

3 participants