Skip to content

Assign files to checkers using balanced import affinity - #4313

Merged
Jake Bailey (jakebailey) merged 14 commits into
mainfrom
jabaile/checker-association-only
Aug 13, 2026
Merged

Assign files to checkers using balanced import affinity#4313
Jake Bailey (jakebailey) merged 14 commits into
mainfrom
jabaile/checker-association-only

Conversation

@jakebailey

@jakebailey Jake Bailey (jakebailey) commented Jun 14, 2026

Copy link
Copy Markdown
Member

Right now, we assign checkers round-robin. I've always suspected that there's a better packing that could be used to make us faster and use less memory.

This PR is the result of letting Copilot churn reading papers, testing things out, experimenting; it eventually found "FENNEL", a MS Research concept (linked below) and adapted it into something that appears to produce a good result for all of the benchmarks without regression.

I then gave it more test cases that it hadn't seen, and those were neutral to positive too.

Notion, Slack, others have tested this and seen similar improvements, roughly 10% faster with 10% less memory. Benchmark run is here as well: #4313 (comment)

As another experiment, I also tried out another branch that used a PRNG to assign files; with #4820 now in place, I could not find any seed on any of our benchmarks that caused new diagnostics, which gives me hope that changing the checker association algorithm is fine.


Copilot-produced algorithm description

The assignment problem is modeled as balanced graph partitioning:

  • Each source file is a vertex.
  • Resolved imports create undirected edges between files.
  • Each partition corresponds to a checker with independent symbol, type, and instantiation caches.

Related files benefit from sharing a checker because checking one file often populates semantic state used by its dependencies and importers. However, placing too many expensive roots on one checker increases the parallel critical path.

The implementation uses a weighted adaptation of FENNEL, a streaming graph-partitioning algorithm. For each file, it chooses the checker maximizing:

already assigned import neighbors
    - convex estimated-load penalty

A hard, best-effort load bound prevents graph affinity from creating substantial estimated imbalance.

Estimated work

The base weight is:

AST node count + source text bytes / 100

Import fanout adds a project-normalized weight. Imports collectively contribute approximately the same weight as local syntax, avoiding a project-specific absolute constant.

Stream order and empirical safeguards

FENNEL is sensitive to vertex order, as discussed in work such as Prioritized Restreaming Algorithms for Balanced Graph Partitioning. This matters especially for the checker because a small source file can trigger large amounts of nonlocal semantic work.

Experiments on VS Code, TypeScript, MUI docs, and XState at 2, 4, and 8 checkers showed that equal estimated loads can still produce badly skewed checker completion times. The final policy therefore uses three calibrated regimes:

  1. Source-dominated projects process implementation files first, ordered by estimated work.
  2. Declaration-heavy projects with four or more checkers preserve program order, increase implementation-file weight, and use stronger balance pressure.
  3. Smaller declaration-heavy checker pools use the unscaled weighted-FENNEL penalty.

The source-dominated threshold and the 4x, 12x, and 16x safety factors were selected through cross-project sweeps. They are intended to compensate for semantic work that the static proxy cannot observe, rather than being constants derived from the FENNEL paper.

The checker pool previously assigned files to checkers with simple
round-robin striping. That balances file count, but adjacent files and
resolved import neighbors often share generic instantiations and
symbol/type links, so the same work is repeated across checker-local
caches.

Start with deterministic weighted blocks to preserve program-order
locality, then run a small FM-style graph refinement over the resolved
import graph. A file can move toward the checker containing more of its
import neighbors only when the target remains under a strict static cost
cap, keeping parallel work balanced.

Perf on ~/work/vscode/src with tsgo -p . --noEmit
--extendedDiagnostics, 5-run average versus main:
Memory allocs 25,210,536 -> 24,028,267 (-1,182,268, -4.7%).
Memory used 4,473,325K -> 4,242,826K (-230,500K, -5.2%).
Check time 4.741s -> 4.294s (-0.447s, -9.4%).
Total time 5.370s -> 4.969s (-0.401s, -7.5%).
Copilot AI review requested due to automatic review settings June 14, 2026 00:59
@jakebailey

Copy link
Copy Markdown
Member Author

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

@typescript-automation

typescript-automation Bot commented Jun 14, 2026

Copy link
Copy Markdown

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.

Pull request overview

Updates the compiler’s checker pooling strategy to assign source files to checkers using a weight-balanced, import-graph-aware affinity algorithm, aiming to improve type-check performance by keeping related files on the same checker while maintaining load balance.

Changes:

  • Added a file-to-checker association algorithm that assigns contiguous file blocks by estimated “work” (text + node + symbol counts).
  • Refined those associations using an undirected import adjacency graph, moving files to increase import-neighbor locality while respecting a balance cap.
  • Added unit tests covering the block sizing, initial weight-based association, and graph refinement behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/compiler/checkerpool.go Implements weight-based checker associations and import-graph refinement, and uses the resulting mapping when creating fileAssociations.
internal/compiler/checkerpool_test.go Adds unit tests for the new association/refinement helpers.

Comment thread internal/compiler/checkerpool_test.go Outdated
@typescript-automation

Copy link
Copy Markdown

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 4 4 ~ ~ ~ p=1.000 n=6
Symbols 81,764 (± 0.04%) 81,796 (± 0.03%) ~ 81,766 81,842 p=0.173 n=6
Types 98,821 98,486 -335 (- 0.34%) ~ ~ p=0.001 n=6
Memory Used 179,747k (± 0.65%) 180,408k (± 0.60%) ~ 178,782k 181,326k p=0.230 n=6
Memory Allocs 1,577,199 (± 0.01%) 1,575,786 (± 0.02%) -1,412 (- 0.09%) 1,575,405 1,576,107 p=0.005 n=6
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Parse Time 0.062s (± 6.05%) 0.063s (±11.35%) ~ 0.054s 0.070s p=0.872 n=6
Bind Time 0.018s (±26.40%) 0.016s (± 9.60%) ~ 0.013s 0.017s p=0.324 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.854s (± 1.77%) 0.808s (± 1.22%) 🟩-0.046s (- 5.43%) 0.798s 0.826s p=0.005 n=6
Total Time 0.935s (± 1.61%) 0.888s (± 1.79%) 🟩-0.048s (- 5.10%) 0.868s 0.912s p=0.005 n=6
angular-1 - native
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 876,293 (± 0.09%) 831,207 (± 0.09%) 🟩-45,086 (- 5.15%) 830,639 832,204 p=0.005 n=6
Types 263,750 (± 0.00%) 236,508 (± 0.00%) 🟩-27,242 (-10.33%) 236,507 236,509 p=0.004 n=6
Memory Used 829,834k (± 0.05%) 807,983k (± 0.10%) -21,851k (- 2.63%) 806,713k 809,103k p=0.005 n=6
Memory Allocs 6,920,410 (± 0.52%) 6,778,086 (± 0.63%) -142,324 (- 2.06%) 6,741,865 6,840,099 p=0.005 n=6
Config Time 0.017s (± 2.98%) 0.017s ~ ~ ~ p=0.174 n=6
Parse Time 0.251s (± 5.98%) 0.251s (± 2.42%) ~ 0.244s 0.259s p=0.936 n=6
Bind Time 0.049s (±37.70%) 0.046s (±26.66%) ~ 0.037s 0.070s p=0.935 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 1.883s (± 1.23%) 1.862s (± 1.42%) ~ 1.828s 1.896s p=0.149 n=6
Total Time 2.215s (± 0.83%) 2.194s (± 1.02%) ~ 2.169s 2.232s p=0.078 n=6
mui-docs - native
Errors 11,244 (± 0.02%) 11,243 (± 0.04%) ~ 11,234 11,246 p=0.870 n=6
Symbols 4,209,758 4,031,231 🟩-178,527 (- 4.24%) ~ ~ p=0.001 n=6
Types 1,532,163 1,410,431 🟩-121,732 (- 7.95%) ~ ~ p=0.001 n=6
Memory Used 4,962,536k (± 0.03%) 4,767,515k (± 0.06%) 🟩-195,021k (- 3.93%) 4,763,359k 4,770,953k p=0.005 n=6
Memory Allocs 82,682,736 (±14.95%) 83,469,664 (±21.61%) ~ 71,019,016 116,405,449 p=0.936 n=6
Config Time 0.016s 0.016s (± 2.52%) ~ 0.016s 0.017s p=0.405 n=6
Parse Time 1.052s (±20.73%) 1.103s (±26.99%) ~ 0.911s 1.671s p=0.575 n=6
Bind Time 0.002s 0.002s ~ ~ ~ p=1.000 n=6
Check Time 17.114s (± 0.57%) 16.623s (± 0.27%) -0.491s (- 2.87%) 16.559s 16.671s p=0.005 n=6
Emit Time 0.455s (± 4.58%) 0.469s (± 3.15%) ~ 0.439s 0.478s p=0.170 n=6
Total Time 19.341s (± 0.90%) 18.892s (± 1.79%) -0.449s (- 2.32%) 18.659s 19.565s p=0.045 n=6
self-build-src - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,394,138 1,360,690 -33,448 (- 2.40%) ~ ~ p=0.001 n=6
Types 442,153 414,656 🟩-27,497 (- 6.22%) ~ ~ p=0.001 n=6
Memory Used 1,647,147k (± 0.13%) 1,603,052k (± 0.28%) -44,095k (- 2.68%) 1,597,847k 1,609,999k p=0.005 n=6
Memory Allocs 55,621,934 (± 0.07%) 53,159,300 (± 0.08%) 🟩-2,462,634 (- 4.43%) 53,105,637 53,237,233 p=0.005 n=6
Config Time 0.015s (±41.91%) 0.014s (±68.27%) ~ 0.005s 0.026s p=0.810 n=6
Parse Time 0.277s (± 4.74%) 0.277s (± 7.84%) ~ 0.251s 0.299s p=0.810 n=6
Bind Time 0.000s (±244.70%) 0.000s ~ ~ ~ p=0.405 n=6
Check Time 2.331s (± 0.97%) 2.258s (± 0.74%) 🟩-0.073s (- 3.11%) 2.242s 2.288s p=0.005 n=6
Emit Time 0.228s (± 2.63%) 0.247s (± 3.46%) 🔻+0.019s (+ 8.35%) 0.240s 0.263s p=0.005 n=6
Total Time 29.845s (± 0.84%) 28.886s (± 0.96%) 🟩-0.959s (- 3.21%) 28.610s 29.195s p=0.005 n=6
self-compiler - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 337,634 332,123 -5,511 (- 1.63%) ~ ~ p=0.001 n=6
Types 199,520 196,635 -2,885 (- 1.45%) ~ ~ p=0.001 n=6
Memory Used 332,123k (± 0.02%) 331,071k (± 0.03%) -1,052k (- 0.32%) 330,896k 331,196k p=0.005 n=6
Memory Allocs 2,416,529 (± 0.02%) 2,412,493 (± 0.02%) -4,036 (- 0.17%) 2,411,919 2,413,067 p=0.005 n=6
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Parse Time 0.132s (± 7.07%) 0.130s (± 4.38%) ~ 0.124s 0.140s p=1.000 n=6
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Check Time 1.405s (± 1.20%) 1.256s (± 0.71%) 🟩-0.149s (-10.60%) 1.240s 1.264s p=0.005 n=6
Emit Time 0.086s (± 3.37%) 0.109s (± 6.54%) 🔻+0.023s (+27.10%) 0.099s 0.121s p=0.005 n=6
Total Time 1.674s (± 1.41%) 1.550s (± 0.84%) 🟩-0.124s (- 7.43%) 1.526s 1.565s p=0.005 n=6
ts-pre-modules - native
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 97,488 97,488 ~ ~ ~ p=1.000 n=6
Types 356 356 ~ ~ ~ p=1.000 n=6
Memory Used 133,452k (± 0.01%) 133,437k (± 0.01%) ~ 133,425k 133,472k p=0.077 n=6
Memory Allocs 182,896 (± 0.22%) 183,123 (± 0.18%) ~ 182,560 183,442 p=0.378 n=6
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Parse Time 0.113s (± 2.68%) 0.116s (± 5.45%) ~ 0.108s 0.127s p=0.260 n=6
Bind Time 0.039s (± 9.10%) 0.039s (±12.86%) ~ 0.031s 0.045s p=0.936 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Total Time 0.156s (± 2.80%) 0.159s (± 5.07%) ~ 0.148s 0.168s p=0.335 n=6
vscode - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 6,633,038 6,158,609 🟩-474,429 (- 7.15%) ~ ~ p=0.001 n=6
Types 2,350,636 2,150,189 🟩-200,447 (- 8.53%) ~ ~ p=0.001 n=6
Memory Used 4,500,200k (± 0.01%) 4,292,522k (± 0.02%) 🟩-207,679k (- 4.61%) 4,291,197k 4,293,236k p=0.005 n=6
Memory Allocs 31,708,706 (± 0.04%) 30,602,376 (± 0.13%) 🟩-1,106,330 (- 3.49%) 30,567,590 30,675,835 p=0.005 n=6
Config Time 0.072s (±12.07%) 0.072s (± 3.92%) ~ 0.069s 0.076s p=0.936 n=6
Parse Time 0.860s (± 5.21%) 0.906s (± 7.27%) ~ 0.850s 1.033s p=0.297 n=6
Bind Time 0.180s (±39.69%) 0.148s (±22.81%) ~ 0.129s 0.216s p=0.335 n=6
Check Time 8.616s (± 0.55%) 7.920s (± 0.87%) 🟩-0.696s (- 8.07%) 7.840s 8.041s p=0.005 n=6
Emit Time 2.193s (± 9.45%) 2.263s (± 6.82%) ~ 1.975s 2.395s p=0.689 n=6
Total Time 11.941s (± 1.19%) 11.386s (± 0.67%) 🟩-0.554s (- 4.64%) 11.276s 11.461s p=0.005 n=6
webpack - native
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 181,653 181,653 ~ ~ ~ p=1.000 n=6
Types 340 340 ~ ~ ~ p=1.000 n=6
Memory Used 219,256k (± 0.07%) 219,438k (± 0.04%) +182k (+ 0.08%) 219,293k 219,545k p=0.031 n=6
Memory Allocs 1,061,228 (± 0.45%) 1,065,514 (± 0.35%) +4,286 (+ 0.40%) 1,062,233 1,072,192 p=0.045 n=6
Config Time 0.012s (±13.23%) 0.012s (± 4.38%) ~ 0.012s 0.013s p=1.000 n=6
Parse Time 0.152s (± 3.55%) 0.151s (± 3.97%) ~ 0.140s 0.158s p=0.687 n=6
Bind Time 0s 0s ~ ~ ~ p=1.000 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.045s (±26.27%) 0.048s (±21.31%) ~ 0.037s 0.063s p=0.521 n=6
Total Time 0.210s (± 4.82%) 0.212s (± 6.96%) ~ 0.197s 0.235s p=0.936 n=6
xstate-main - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,063,023 991,543 🟩-71,480 (- 6.72%) ~ ~ p=0.001 n=6
Types 387,762 354,697 🟩-33,065 (- 8.53%) ~ ~ p=0.001 n=6
Memory Used 641,557k (± 0.02%) 610,312k (± 0.04%) 🟩-31,245k (- 4.87%) 609,963k 610,670k p=0.005 n=6
Memory Allocs 5,043,915 (± 0.05%) 4,769,873 (± 0.08%) 🟩-274,042 (- 5.43%) 4,762,655 4,774,414 p=0.005 n=6
Config Time 0.005s 0.005s (±17.48%) ~ 0.003s 0.005s p=0.405 n=6
Parse Time 0.131s (± 4.57%) 0.136s (± 5.36%) ~ 0.125s 0.147s p=0.229 n=6
Bind Time 0.037s (±27.83%) 0.036s (±15.80%) ~ 0.029s 0.042s p=0.872 n=6
Check Time 1.300s (± 1.04%) 1.464s (± 0.94%) 🔻+0.164s (+12.63%) 1.447s 1.481s p=0.005 n=6
Emit Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Total Time 1.478s (± 0.50%) 1.650s (± 0.79%) 🔻+0.172s (+11.64%) 1.635s 1.666s p=0.005 n=6
System info unknown
Hosts
  • native
Scenarios
  • Compiler-Unions - native
  • angular-1 - native
  • mui-docs - native
  • self-build-src - native
  • self-compiler - native
  • ts-pre-modules - native
  • vscode - native
  • webpack - native
  • xstate-main - native
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

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.

This seems really neat. I think the algorithm is mostly understandable, but would prefer some more comments at each point to explain what's happening (e.g. at each loop, it's not immediately clear what we're about to do next)

Comment thread internal/compiler/checkerpool.go Outdated
Comment thread internal/compiler/checkerpool.go Outdated
Comment thread internal/compiler/checkerpool.go Outdated
Comment thread internal/compiler/checkerpool.go Outdated

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread internal/compiler/checkerpool.go Outdated
Comment thread internal/compiler/checkerpool.go Outdated
@jakebailey

Copy link
Copy Markdown
Member Author

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

@typescript-automation

typescript-automation Bot commented Jun 16, 2026

Copy link
Copy Markdown

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

Command Status Results
perf test this faster ✅ Started 👀 Results

@typescript-automation

Copy link
Copy Markdown

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 4 4 ~ ~ ~ p=1.000 n=6
Symbols 81,777 (± 0.02%) 81,648 (± 0.02%) -129 (- 0.16%) 81,631 81,686 p=0.005 n=6
Types 98,821 98,040 -781 (- 0.79%) ~ ~ p=0.001 n=6
Memory Used 180,298k (± 0.57%) 182,462k (± 0.60%) +2,164k (+ 1.20%) 180,739k 183,654k p=0.020 n=6
Memory Allocs 1,577,295 (± 0.01%) 1,575,462 (± 0.01%) -1,833 (- 0.12%) 1,575,296 1,575,804 p=0.005 n=6
Config Time 0.000s (±244.70%) 0.000s ~ ~ ~ p=0.405 n=6
Parse Time 0.065s (± 6.35%) 0.062s (±12.52%) ~ 0.050s 0.072s p=0.574 n=6
Bind Time 0.016s (±21.91%) 0.017s (±30.86%) ~ 0.013s 0.027s p=0.936 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.849s (± 1.11%) 0.794s (± 1.78%) 🟩-0.055s (- 6.44%) 0.783s 0.821s p=0.005 n=6
Total Time 0.931s (± 1.17%) 0.874s (± 2.18%) 🟩-0.057s (- 6.10%) 0.856s 0.900s p=0.005 n=6
angular-1 - native
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 876,696 (± 0.04%) 838,986 (± 0.24%) 🟩-37,710 (- 4.30%) 837,350 842,827 p=0.005 n=6
Types 263,750 (± 0.00%) 241,510 (± 0.00%) 🟩-22,240 (- 8.43%) 241,508 241,511 p=0.005 n=6
Memory Used 830,275k (± 0.05%) 813,503k (± 0.06%) -16,772k (- 2.02%) 812,806k 814,169k p=0.005 n=6
Memory Allocs 6,901,527 (± 0.22%) 6,798,486 (± 0.17%) -103,040 (- 1.49%) 6,780,726 6,810,033 p=0.005 n=6
Config Time 0.018s (± 6.85%) 0.017s (± 2.38%) ~ 0.017s 0.018s p=0.527 n=6
Parse Time 0.249s (± 5.81%) 0.242s (± 2.49%) ~ 0.232s 0.248s p=0.520 n=6
Bind Time 0.047s (±37.49%) 0.059s (±38.76%) ~ 0.035s 0.099s p=0.336 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 1.865s (± 1.80%) 1.939s (± 1.65%) +0.075s (+ 3.99%) 1.903s 1.998s p=0.008 n=6
Total Time 2.190s (± 1.53%) 2.287s (± 2.03%) 🔻+0.097s (+ 4.43%) 2.246s 2.378s p=0.008 n=6
mui-docs - native
Errors 11,242 (± 0.01%) 11,243 (± 0.03%) ~ 11,237 11,246 p=0.250 n=6
Symbols 4,209,747 3,919,939 🟩-289,808 (- 6.88%) ~ ~ p=0.001 n=6
Types 1,532,197 1,335,393 🟩-196,804 (-12.84%) ~ ~ p=0.001 n=6
Memory Used 4,961,978k (± 0.05%) 4,698,587k (± 0.08%) 🟩-263,391k (- 5.31%) 4,694,422k 4,704,376k p=0.005 n=6
Memory Allocs 73,773,977 (± 9.60%) 83,643,543 (±27.22%) ~ 63,490,585 121,718,979 p=0.936 n=6
Config Time 0.018s (±10.05%) 0.016s (± 4.65%) ~ 0.015s 0.017s p=0.081 n=6
Parse Time 0.928s (±14.14%) 1.084s (±32.30%) ~ 0.782s 1.684s p=0.810 n=6
Bind Time 0.002s 0.002s ~ ~ ~ p=1.000 n=6
Check Time 16.953s (± 0.57%) 17.523s (± 0.68%) +0.570s (+ 3.36%) 17.386s 17.737s p=0.005 n=6
Emit Time 0.450s (± 4.91%) 0.453s (± 4.35%) ~ 0.431s 0.473s p=0.573 n=6
Total Time 19.076s (± 0.92%) 19.736s (± 1.54%) +0.659s (+ 3.46%) 19.400s 20.263s p=0.008 n=6
self-build-src - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,394,138 1,365,530 -28,608 (- 2.05%) ~ ~ p=0.001 n=6
Types 442,153 420,781 🟩-21,372 (- 4.83%) ~ ~ p=0.001 n=6
Memory Used 1,651,957k (± 0.37%) 1,616,664k (± 0.22%) -35,293k (- 2.14%) 1,612,538k 1,620,922k p=0.005 n=6
Memory Allocs 55,653,668 (± 0.09%) 53,771,790 (± 0.05%) 🟩-1,881,878 (- 3.38%) 53,738,756 53,816,940 p=0.005 n=6
Config Time 0.016s (±37.31%) 0.022s (±31.23%) ~ 0.014s 0.032s p=0.149 n=6
Parse Time 0.275s (± 5.97%) 0.266s (± 6.06%) ~ 0.251s 0.297s p=0.470 n=6
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Check Time 2.327s (± 0.70%) 2.297s (± 0.52%) -0.030s (- 1.28%) 2.277s 2.313s p=0.031 n=6
Emit Time 0.223s (± 3.26%) 0.251s (± 6.44%) 🔻+0.028s (+12.47%) 0.236s 0.281s p=0.005 n=6
Total Time 29.655s (± 0.77%) 28.637s (± 1.43%) 🟩-1.019s (- 3.43%) 28.306s 29.439s p=0.008 n=6
self-compiler - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 337,634 331,555 -6,079 (- 1.80%) ~ ~ p=0.001 n=6
Types 199,520 196,291 -3,229 (- 1.62%) ~ ~ p=0.001 n=6
Memory Used 332,417k (± 0.03%) 330,867k (± 0.02%) -1,551k (- 0.47%) 330,763k 330,966k p=0.005 n=6
Memory Allocs 2,416,561 (± 0.02%) 2,411,042 (± 0.01%) -5,519 (- 0.23%) 2,410,698 2,411,578 p=0.005 n=6
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Parse Time 0.131s (± 4.34%) 0.131s (± 4.48%) ~ 0.125s 0.141s p=0.936 n=6
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Check Time 1.384s (± 0.75%) 1.245s (± 1.24%) 🟩-0.138s (-10.01%) 1.228s 1.269s p=0.005 n=6
Emit Time 0.096s (± 6.17%) 0.103s (± 5.92%) ~ 0.093s 0.109s p=0.128 n=6
Total Time 1.664s (± 0.98%) 1.534s (± 0.87%) 🟩-0.131s (- 7.84%) 1.511s 1.545s p=0.005 n=6
ts-pre-modules - native
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 97,488 97,488 ~ ~ ~ p=1.000 n=6
Types 356 356 ~ ~ ~ p=1.000 n=6
Memory Used 133,695k (± 0.01%) 133,723k (± 0.01%) +28k (+ 0.02%) 133,710k 133,750k p=0.020 n=6
Memory Allocs 183,094 (± 0.19%) 183,186 (± 0.17%) ~ 182,895 183,736 p=1.000 n=6
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Parse Time 0.114s (± 5.81%) 0.114s (± 4.99%) ~ 0.106s 0.119s p=1.000 n=6
Bind Time 0.041s (± 8.30%) 0.040s (±18.36%) ~ 0.029s 0.051s p=0.572 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Total Time 0.159s (± 4.26%) 0.157s (± 5.87%) ~ 0.148s 0.171s p=0.689 n=6
vscode - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 6,633,022 6,295,465 🟩-337,557 (- 5.09%) ~ ~ p=0.001 n=6
Types 2,354,036 2,199,025 🟩-155,011 (- 6.58%) ~ ~ p=0.001 n=6
Memory Used 4,510,892k (± 0.01%) 4,360,235k (± 0.02%) 🟩-150,657k (- 3.34%) 4,359,121k 4,361,039k p=0.005 n=6
Memory Allocs 31,826,206 (± 0.10%) 30,900,164 (± 0.08%) -926,042 (- 2.91%) 30,881,393 30,945,764 p=0.005 n=6
Config Time 0.068s (± 8.41%) 0.073s (± 5.55%) ~ 0.068s 0.078s p=0.126 n=6
Parse Time 0.890s (± 2.92%) 0.892s (± 3.68%) ~ 0.857s 0.948s p=0.748 n=6
Bind Time 0.131s (± 2.43%) 0.171s (±36.05%) ~ 0.129s 0.269s p=0.148 n=6
Check Time 8.747s (± 1.80%) 8.759s (± 0.55%) ~ 8.693s 8.814s p=0.230 n=6
Emit Time 2.285s (± 7.35%) 2.307s (±10.16%) ~ 1.987s 2.477s p=0.229 n=6
Total Time 12.136s (± 0.90%) 12.280s (± 1.35%) ~ 12.073s 12.461s p=0.128 n=6
webpack - native
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 181,893 181,893 ~ ~ ~ p=1.000 n=6
Types 340 340 ~ ~ ~ p=1.000 n=6
Memory Used 219,848k (± 0.13%) 219,918k (± 0.09%) ~ 219,651k 220,167k p=0.936 n=6
Memory Allocs 1,060,813 (± 0.33%) 1,071,025 (± 0.54%) +10,212 (+ 0.96%) 1,066,183 1,080,150 p=0.005 n=6
Config Time 0.010s (±13.21%) 0.011s (±12.26%) ~ 0.009s 0.013s p=0.676 n=6
Parse Time 0.153s (± 3.34%) 0.153s (± 5.29%) ~ 0.138s 0.162s p=0.936 n=6
Bind Time 0s 0s ~ ~ ~ p=1.000 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.039s (±20.39%) 0.041s (±22.97%) ~ 0.032s 0.058s p=0.688 n=6
Total Time 0.202s (± 4.97%) 0.206s (± 3.60%) ~ 0.195s 0.217s p=0.470 n=6
xstate-main - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,065,023 1,003,461 🟩-61,562 (- 5.78%) ~ ~ p=0.001 n=6
Types 389,185 355,325 🟩-33,860 (- 8.70%) ~ ~ p=0.001 n=6
Memory Used 643,144k (± 0.02%) 614,036k (± 0.02%) 🟩-29,108k (- 4.53%) 613,930k 614,251k p=0.005 n=6
Memory Allocs 5,062,673 (± 0.07%) 4,811,864 (± 0.14%) 🟩-250,809 (- 4.95%) 4,805,662 4,821,124 p=0.005 n=6
Config Time 0.004s (±23.57%) 0.005s ~ ~ ~ p=0.073 n=6
Parse Time 0.134s (± 2.00%) 0.133s (± 3.34%) ~ 0.130s 0.139s p=0.623 n=6
Bind Time 0.033s (±22.53%) 0.039s (±23.25%) ~ 0.027s 0.050s p=0.228 n=6
Check Time 1.310s (± 0.37%) 1.313s (± 1.59%) ~ 1.294s 1.340s p=0.575 n=6
Emit Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Total Time 1.486s (± 0.35%) 1.499s (± 1.33%) ~ 1.478s 1.525s p=0.298 n=6
System info unknown
Hosts
  • native
Scenarios
  • Compiler-Unions - native
  • angular-1 - native
  • mui-docs - native
  • self-build-src - native
  • self-compiler - native
  • ts-pre-modules - native
  • vscode - native
  • webpack - native
  • xstate-main - native
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@jakebailey

Copy link
Copy Markdown
Member Author

Weird. Simplifying the algorithm to just use text made it a lot worse in time?

@jakebailey

Copy link
Copy Markdown
Member Author

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

@typescript-automation

typescript-automation Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

Command Status Results
perf test this faster ✅ Started 👀 Results

@typescript-automation

Copy link
Copy Markdown

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 4 4 ~ ~ ~ p=1.000 n=6
Symbols 81,767 (± 0.03%) 81,623 (± 0.02%) -145 (- 0.18%) 81,589 81,649 p=0.005 n=6
Types 98,821 98,040 -781 (- 0.79%) ~ ~ p=0.001 n=6
Memory Used 179,959k (± 0.47%) 182,360k (± 0.59%) +2,401k (+ 1.33%) 180,487k 183,437k p=0.013 n=6
Memory Allocs 2,547,262 (± 0.01%) 2,545,221 (± 0.01%) -2,042 (- 0.08%) 2,545,060 2,545,385 p=0.005 n=6
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Parse Time 0.055s (±11.20%) 0.054s (± 4.74%) ~ 0.051s 0.058s p=0.935 n=6
Bind Time 0.019s (±18.20%) 0.019s (±22.37%) ~ 0.015s 0.024s p=0.935 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.877s (± 1.37%) 0.822s (± 1.24%) 🟩-0.055s (- 6.25%) 0.813s 0.837s p=0.005 n=6
Total Time 0.952s (± 1.25%) 0.896s (± 1.08%) 🟩-0.056s (- 5.86%) 0.884s 0.909s p=0.005 n=6
angular-1 - native
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 876,924 (± 0.09%) 838,383 (± 0.17%) 🟩-38,541 (- 4.40%) 836,428 839,610 p=0.005 n=6
Types 263,749 (± 0.00%) 241,509 (± 0.00%) 🟩-22,240 (- 8.43%) 241,508 241,510 p=0.005 n=6
Memory Used 831,093k (± 0.08%) 813,637k (± 0.08%) -17,456k (- 2.10%) 812,687k 814,446k p=0.005 n=6
Memory Allocs 12,660,858 (± 0.25%) 12,544,415 (± 0.19%) -116,443 (- 0.92%) 12,530,609 12,593,223 p=0.005 n=6
Config Time 0.017s (± 2.38%) 0.017s (± 2.38%) ~ 0.017s 0.018s p=1.000 n=6
Parse Time 0.255s (± 2.66%) 0.246s (± 2.86%) ~ 0.239s 0.256s p=0.078 n=6
Bind Time 0.052s (±24.80%) 0.047s (±32.69%) ~ 0.035s 0.074s p=0.630 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 1.911s (± 2.02%) 1.998s (± 0.47%) 🔻+0.087s (+ 4.53%) 1.987s 2.010s p=0.005 n=6
Total Time 2.252s (± 0.99%) 2.331s (± 0.72%) +0.079s (+ 3.50%) 2.308s 2.355s p=0.005 n=6
mui-docs - native
Errors 11,279 (± 0.03%) 11,281 (± 0.01%) ~ 11,279 11,282 p=0.607 n=6
Symbols 4,750,724 3,795,873 🟩-954,851 (-20.10%) ~ ~ p=0.001 n=6
Types 1,703,820 1,299,794 🟩-404,026 (-23.71%) ~ ~ p=0.001 n=6
Memory Used 5,926,736k (± 0.01%) 4,012,862k (± 0.03%) 🟩-1,913,874k (-32.29%) 4,011,126k 4,014,732k p=0.005 n=6
Memory Allocs 55,959,471 (± 0.08%) 40,015,507 (± 0.10%) 🟩-15,943,964 (-28.49%) 39,943,859 40,051,299 p=0.005 n=6
Config Time 0.016s (± 3.16%) 0.016s ~ ~ ~ p=0.174 n=6
Parse Time 0.537s (± 2.93%) 0.544s (± 2.18%) ~ 0.526s 0.557s p=0.298 n=6
Bind Time 0.002s 0.002s (±18.82%) ~ 0.002s 0.003s p=0.405 n=6
Check Time 17.498s (± 0.17%) 17.790s (± 0.90%) +0.292s (+ 1.67%) 17.680s 18.066s p=0.005 n=6
Emit Time 0.445s (± 4.31%) 0.459s (± 3.75%) ~ 0.436s 0.476s p=0.128 n=6
Total Time 19.259s (± 0.19%) 19.521s (± 1.23%) +0.262s (+ 1.36%) 19.297s 19.852s p=0.008 n=6
self-build-src - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,394,272 1,365,564 -28,708 (- 2.06%) ~ ~ p=0.001 n=6
Types 442,242 420,819 🟩-21,423 (- 4.84%) ~ ~ p=0.001 n=6
Memory Used 1,650,225k (± 0.10%) 1,617,416k (± 0.13%) -32,809k (- 1.99%) 1,615,001k 1,620,929k p=0.005 n=6
Memory Allocs 98,373,948 (± 0.05%) 96,506,066 (± 0.04%) -1,867,882 (- 1.90%) 96,460,572 96,551,438 p=0.005 n=6
Config Time 0.020s (±12.72%) 0.014s (±50.57%) ~ 0.008s 0.023s p=0.334 n=6
Parse Time 0.269s (± 3.05%) 0.268s (± 7.94%) ~ 0.230s 0.290s p=0.748 n=6
Bind Time 0.000s (±244.70%) 0.000s ~ ~ ~ p=0.405 n=6
Check Time 2.319s (± 0.63%) 2.293s (± 0.73%) -0.026s (- 1.10%) 2.264s 2.312s p=0.031 n=6
Emit Time 0.291s (± 2.96%) 0.291s (± 2.32%) ~ 0.283s 0.299s p=0.873 n=6
Total Time 30.385s (± 0.45%) 28.928s (± 1.09%) 🟩-1.456s (- 4.79%) 28.426s 29.372s p=0.005 n=6
self-compiler - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 337,637 331,557 -6,080 (- 1.80%) ~ ~ p=0.001 n=6
Types 199,520 196,291 -3,229 (- 1.62%) ~ ~ p=0.001 n=6
Memory Used 332,565k (± 0.05%) 330,940k (± 0.03%) -1,625k (- 0.49%) 330,758k 331,017k p=0.005 n=6
Memory Allocs 4,761,121 (± 0.01%) 4,754,906 (± 0.02%) -6,215 (- 0.13%) 4,753,654 4,755,959 p=0.005 n=6
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Parse Time 0.122s (± 2.36%) 0.125s (± 2.35%) ~ 0.121s 0.130s p=0.104 n=6
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Check Time 1.374s (± 0.43%) 1.246s (± 1.46%) 🟩-0.127s (- 9.25%) 1.222s 1.267s p=0.005 n=6
Emit Time 0.128s (± 6.51%) 0.115s (± 8.65%) 🟩-0.012s (- 9.80%) 0.108s 0.135s p=0.036 n=6
Total Time 1.678s (± 0.86%) 1.539s (± 1.18%) 🟩-0.138s (- 8.24%) 1.512s 1.560s p=0.005 n=6
ts-pre-modules - native
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 97,488 97,488 ~ ~ ~ p=1.000 n=6
Types 356 356 ~ ~ ~ p=1.000 n=6
Memory Used 133,727k (± 0.02%) 133,726k (± 0.03%) ~ 133,682k 133,782k p=0.936 n=6
Memory Allocs 182,535 (± 0.13%) 182,804 (± 0.22%) ~ 182,285 183,305 p=0.230 n=6
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Parse Time 0.109s (± 5.97%) 0.110s (± 3.85%) ~ 0.104s 0.115s p=0.574 n=6
Bind Time 0.040s (± 8.95%) 0.039s (±19.59%) ~ 0.030s 0.047s p=1.000 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Total Time 0.153s (± 3.69%) 0.153s (± 4.74%) ~ 0.145s 0.164s p=1.000 n=6
vscode - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 6,825,484 6,400,705 🟩-424,779 (- 6.22%) ~ ~ p=0.001 n=6
Types 2,412,968 2,233,986 🟩-178,982 (- 7.42%) ~ ~ p=0.001 n=6
Memory Used 4,631,020k (± 0.02%) 4,452,349k (± 0.02%) 🟩-178,671k (- 3.86%) 4,451,593k 4,453,710k p=0.005 n=6
Memory Allocs 32,947,671 (± 0.07%) 31,944,013 (± 0.04%) 🟩-1,003,657 (- 3.05%) 31,934,732 31,971,301 p=0.005 n=6
Config Time 0.079s (± 8.64%) 0.069s (± 9.15%) 🟩-0.010s (-12.08%) 0.061s 0.077s p=0.020 n=6
Parse Time 0.893s (± 2.69%) 0.890s (± 2.24%) ~ 0.852s 0.908s p=0.936 n=6
Bind Time 0.158s (±35.60%) 0.151s (±22.80%) ~ 0.135s 0.222s p=0.572 n=6
Check Time 8.631s (± 0.76%) 8.509s (± 1.03%) -0.122s (- 1.41%) 8.427s 8.668s p=0.045 n=6
Emit Time 2.357s (± 7.52%) 2.455s (± 6.36%) ~ 2.159s 2.604s p=0.128 n=6
Total Time 12.137s (± 0.64%) 12.153s (± 0.60%) ~ 12.070s 12.269s p=0.936 n=6
webpack - native
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 184,308 184,308 ~ ~ ~ p=1.000 n=6
Types 340 340 ~ ~ ~ p=1.000 n=6
Memory Used 224,292k (± 0.15%) 224,158k (± 0.06%) ~ 223,921k 224,253k p=0.689 n=6
Memory Allocs 1,085,849 (± 0.51%) 1,090,251 (± 1.24%) ~ 1,081,421 1,116,865 p=1.000 n=6
Config Time 0.011s (± 9.67%) 0.011s (±11.65%) ~ 0.009s 0.012s p=0.931 n=6
Parse Time 0.152s (± 3.40%) 0.151s (± 3.22%) ~ 0.145s 0.156s p=0.935 n=6
Bind Time 0s 0s ~ ~ ~ p=1.000 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.041s (±24.99%) 0.047s (±21.76%) ~ 0.036s 0.061s p=0.298 n=6
Total Time 0.204s (± 6.79%) 0.209s (± 4.87%) ~ 0.198s 0.227s p=0.810 n=6
xstate-main - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,065,144 1,003,348 🟩-61,796 (- 5.80%) ~ ~ p=0.001 n=6
Types 389,314 355,318 🟩-33,996 (- 8.73%) ~ ~ p=0.001 n=6
Memory Used 643,865k (± 0.02%) 614,520k (± 0.02%) 🟩-29,345k (- 4.56%) 614,279k 614,669k p=0.005 n=6
Memory Allocs 5,103,941 (± 0.18%) 4,856,310 (± 0.21%) 🟩-247,631 (- 4.85%) 4,845,252 4,875,040 p=0.005 n=6
Config Time 0.005s (±11.05%) 0.005s (± 8.44%) ~ 0.004s 0.005s p=0.595 n=6
Parse Time 0.132s (± 3.78%) 0.131s (± 1.74%) ~ 0.128s 0.133s p=0.686 n=6
Bind Time 0.031s (±18.94%) 0.032s (±24.49%) ~ 0.025s 0.044s p=0.936 n=6
Check Time 1.316s (± 0.62%) 1.331s (± 1.22%) ~ 1.310s 1.347s p=0.173 n=6
Emit Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Total Time 1.488s (± 0.65%) 1.510s (± 0.67%) +0.022s (+ 1.48%) 1.499s 1.522s p=0.008 n=6
System info unknown
Hosts
  • native
Scenarios
  • Compiler-Unions - native
  • angular-1 - native
  • mui-docs - native
  • self-build-src - native
  • self-compiler - native
  • ts-pre-modules - native
  • vscode - native
  • webpack - native
  • xstate-main - native
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@jakebailey

Copy link
Copy Markdown
Member Author

That is the result I'm expecting, FWIW.

Is this PR explained enough?

@ahejlsberg

Copy link
Copy Markdown
Member

I like the improvements, even if it mostly seems to be around memory consumption. I'm surprised the initial compile time improvement for VS Code evaporated. Any idea why?

@jakebailey

Copy link
Copy Markdown
Member Author

It was my last change; the weird count stuff is apparently load bearing in vscode. I'm going to have to think about a more principled way to weight files...

@jakebailey

Copy link
Copy Markdown
Member Author

Hm, so it seems like the effect from the "complexity" estimation is more important than I thought. The import graph still matters, but just shifting files around by how complicated they look does seem to matter even more.

I had copilot do a big matrix of different things and am about to push a new one which changes the algorithm again to, which it described as:


Phase 1: Work-balanced initial assignment

Use LPT, or longest-processing-time-first scheduling.

for each source file:
    weight = file.NodeCount + len(file.Text) / 100

sort files by descending weight, preserving file order for ties

for each file in sorted order:
    checker = checker with the smallest current total weight
    assign file to checker
    checker.totalWeight += file.weight

This directly targets the critical path: wall-clock check time is bounded by the slowest checker bucket.

Phase 2: Import-graph locality refinement

Build an undirected graph where two files are adjacent if one imports the other.

for a small fixed number of passes:
    for each file:
        count how many import neighbors are assigned to each checker
        candidate = checker with the largest neighbor-locality gain

        if candidate improves locality and stays under the load cap:
            move file to candidate

The load cap is roughly averageCheckerWeight + 2%, but never below the largest single file weight.

Summary

The ordering is the important part: balance checker work first, then improve import locality within that balance budget. LPT gives a good max-load baseline, and graph refinement recovers checker cache locality without being allowed to create a new overloaded checker.

Assign files to checkers with longest-processing-time-first scheduling
before running the import-graph refinement pass. The estimated work for a
file is now its node count plus one unit per 100 bytes of source text,
which better tracks checker work than source text size alone.

Measured on ~/work/vscode/src with tsgo -p . --noEmit
--extendedDiagnostics, 5-run average versus the current text+graph
assignment:

- current text+graph: Check time 9.168s, Total time 10.298s,
  Symbols 6,407,330, Types 2,217,598, Memory 4,394,421K, Allocs
  24,807,475.
- pre-text old-weight+graph: Check time 8.740s (-4.7%), Total time
  10.028s (-2.6%), Symbols -0.5%, Types -0.8%, Memory -0.5%, Allocs
  -0.2%.
- LPT node+text+graph: Check time 8.457s (-7.8%), Total time 9.587s
  (-6.9%), Symbols +0.9%, Types +1.2%, Memory +0.5%, Allocs +0.7%.
- LPT old-weight+graph: Check time 8.485s (-7.5%), Total time 9.632s
  (-6.5%), Symbols ~, Types +0.3%, Memory -0.2%, Allocs +0.2%.

The import graph remains useful: removing graph refinement from the LPT
variants preserved some check-time improvement but increased symbols,
types, memory, and allocations by roughly 4-8% on this benchmark.
@jakebailey

Copy link
Copy Markdown
Member Author

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

@typescript-automation

typescript-automation Bot commented Jul 31, 2026

Copy link
Copy Markdown

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

Command Status Results
perf test this faster ✅ Started 👀 Results

@typescript-automation

Copy link
Copy Markdown

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=12
Symbols 119,733 118,775 -958 (- 0.80%) ~ ~ p=0.000 n=12
Types 99,032 98,290 -742 (- 0.75%) ~ ~ p=0.000 n=12
Memory Used 151,225k (± 0.46%) 150,988k (± 0.57%) ~ 149,021k 152,937k p=0.799 n=12
Memory Allocs 2,262,965 (± 0.00%) 2,259,000 (± 0.00%) -3,965 (- 0.18%) 2,258,820 2,259,210 p=0.000 n=12
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Parse Time 0.040s (± 3.95%) 0.041s (± 3.77%) ~ 0.037s 0.044s p=0.853 n=12
Bind Time 0.012s (± 9.82%) 0.012s (±12.99%) ~ 0.010s 0.019s p=0.361 n=12
Check Time 0.732s (± 0.75%) 0.525s (± 0.72%) 🟩-0.207s (-28.23%) 0.516s 0.534s p=0.000 n=12
Emit Time 0.287s (± 1.20%) 0.273s (± 2.14%) 🟩-0.014s (- 4.74%) 0.262s 0.288s p=0.002 n=12
Total Time 1.078s (± 0.61%) 0.857s (± 0.69%) 🟩-0.221s (-20.50%) 0.845s 0.875s p=0.000 n=12
angular-1 - native
Errors 3 3 ~ ~ ~ p=1.000 n=12
Symbols 872,614 (± 0.11%) 847,693 (± 0.06%) -24,921 (- 2.86%) 846,435 849,613 p=0.000 n=12
Types 263,961 (± 0.00%) 249,047 (± 0.00%) 🟩-14,914 (- 5.65%) 249,044 249,051 p=0.000 n=12
Memory Used 806,339k (± 0.04%) 794,673k (± 0.05%) -11,665k (- 1.45%) 793,541k 795,477k p=0.000 n=12
Memory Allocs 13,123,998 (± 0.10%) 13,049,988 (± 0.02%) -74,011 (- 0.56%) 13,044,378 13,058,560 p=0.000 n=12
Config Time 0.017s (± 1.99%) 0.017s (± 1.86%) ~ 0.016s 0.017s p=0.680 n=12
Parse Time 0.279s (± 2.05%) 0.282s (± 2.73%) ~ 0.256s 0.299s p=0.417 n=12
Bind Time 0.061s (± 8.34%) 0.063s (±10.27%) ~ 0.058s 0.089s p=0.624 n=12
Check Time 0s 0s ~ ~ ~ p=1.000 n=12
Emit Time 1.703s (± 1.40%) 1.675s (± 0.89%) -0.028s (- 1.63%) 1.645s 1.739s p=0.008 n=12
Total Time 2.069s (± 1.32%) 2.053s (± 0.87%) ~ 2.022s 2.133s p=0.139 n=12
mui-docs - native
Errors 11,277 (± 0.03%) 11,278 (± 0.02%) ~ 11,269 11,282 p=0.897 n=12
Symbols 4,387,605 4,033,914 🟩-353,691 (- 8.06%) ~ ~ p=0.000 n=12
Types 1,540,346 1,575,142 +34,796 (+ 2.26%) ~ ~ p=0.000 n=12
Memory Used 4,965,830k (± 0.03%) 4,174,849k (± 0.02%) 🟩-790,981k (-15.93%) 4,171,771k 4,176,838k p=0.000 n=12
Memory Allocs 45,315,563 (± 0.03%) 45,945,239 (± 0.04%) +629,676 (+ 1.39%) 45,898,958 45,986,519 p=0.000 n=12
Config Time 0.016s (± 1.55%) 0.016s ~ ~ ~ p=0.478 n=12
Parse Time 0.549s (± 2.40%) 0.554s (± 2.21%) ~ 0.512s 0.581s p=0.560 n=12
Bind Time 0.002s 0.002s ~ ~ ~ p=1.000 n=12
Check Time 16.325s (± 0.48%) 14.915s (± 0.32%) 🟩-1.410s (- 8.64%) 14.818s 15.038s p=0.000 n=12
Emit Time 0.450s (± 2.27%) 0.454s (± 2.56%) ~ 0.436s 0.479s p=0.943 n=12
Total Time 18.068s (± 0.45%) 16.670s (± 0.12%) 🟩-1.399s (- 7.74%) 16.601s 16.715s p=0.000 n=12
self-build-src - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 1,394,491 1,392,292 -2,199 (- 0.16%) ~ ~ p=0.000 n=12
Types 442,212 443,118 +906 (+ 0.20%) ~ ~ p=0.000 n=12
Memory Used 1,634,419k (± 0.22%) 1,636,172k (± 0.36%) ~ 1,620,529k 1,647,070k p=0.478 n=12
Memory Allocs 97,065,099 (± 0.04%) 96,723,647 (± 0.04%) -341,453 (- 0.35%) 96,608,527 96,797,596 p=0.000 n=12
Config Time 0.003s (± 9.48%) 0.003s (±12.29%) ~ 0.002s 0.004s p=1.000 n=12
Parse Time 0.197s (± 2.59%) 0.195s (± 1.91%) ~ 0.186s 0.207s p=0.744 n=12
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Check Time 2.033s (± 0.51%) 1.860s (± 0.65%) 🟩-0.173s (- 8.49%) 1.836s 1.894s p=0.000 n=12
Emit Time 0.300s (± 4.72%) 0.310s (± 4.01%) ~ 0.272s 0.339s p=0.385 n=12
Total Time 27.333s (± 0.68%) 25.450s (± 0.56%) 🟩-1.883s (- 6.89%) 25.146s 25.780s p=0.000 n=12
self-compiler - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 337,834 338,124 +290 (+ 0.09%) ~ ~ p=0.000 n=12
Types 199,561 198,606 -955 (- 0.48%) ~ ~ p=0.000 n=12
Memory Used 318,305k (± 0.02%) 319,777k (± 0.02%) +1,472k (+ 0.46%) 319,617k 319,953k p=0.000 n=12
Memory Allocs 4,659,386 (± 0.01%) 4,660,809 (± 0.01%) +1,423 (+ 0.03%) 4,659,284 4,662,481 p=0.000 n=12
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=12
Parse Time 0.117s (± 4.61%) 0.116s (± 4.66%) ~ 0.103s 0.131s p=0.831 n=12
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Check Time 1.214s (± 0.49%) 1.065s (± 0.70%) 🟩-0.149s (-12.25%) 1.049s 1.082s p=0.000 n=12
Emit Time 0.174s (± 3.99%) 0.158s (± 6.18%) 🟩-0.016s (- 9.43%) 0.136s 0.186s p=0.010 n=12
Total Time 1.561s (± 0.58%) 1.391s (± 0.89%) 🟩-0.170s (-10.90%) 1.364s 1.420s p=0.000 n=12
ts-pre-modules - native
Errors 87 87 ~ ~ ~ p=1.000 n=12
Symbols 302,246 305,220 +2,974 (+ 0.98%) ~ ~ p=0.000 n=12
Types 181,594 181,907 +313 (+ 0.17%) ~ ~ p=0.000 n=12
Memory Used 274,470k (± 0.01%) 277,584k (± 0.02%) +3,114k (+ 1.13%) 277,462k 277,744k p=0.000 n=12
Memory Allocs 1,661,346 (± 0.01%) 1,625,572 (± 0.01%) -35,774 (- 2.15%) 1,625,252 1,625,997 p=0.000 n=12
Config Time 0.000s (±217.90%) 0.000s (±217.90%) ~ 0.000s 0.001s p=1.000 n=12
Parse Time 0.100s (± 4.10%) 0.102s (± 4.69%) ~ 0.086s 0.112s p=0.310 n=12
Bind Time 0.039s (± 9.40%) 0.036s (± 9.36%) ~ 0.028s 0.047s p=0.234 n=12
Check Time 0.990s (± 0.62%) 0.843s (± 0.54%) 🟩-0.147s (-14.81%) 0.836s 0.857s p=0.000 n=12
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Total Time 1.142s (± 0.58%) 0.995s (± 0.80%) 🟩-0.147s (-12.84%) 0.972s 1.015s p=0.000 n=12
vscode - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 7,619,568 7,277,452 🟩-342,116 (- 4.49%) ~ ~ p=0.000 n=12
Types 2,648,938 2,507,090 🟩-141,848 (- 5.35%) ~ ~ p=0.000 n=12
Memory Used 5,079,345k (± 0.03%) 4,909,991k (± 0.02%) 🟩-169,354k (- 3.33%) 4,908,309k 4,912,326k p=0.000 n=12
Memory Allocs 38,593,305 (± 0.01%) 37,777,074 (± 0.01%) -816,230 (- 2.11%) 37,770,536 37,794,216 p=0.000 n=12
Config Time 0.058s (± 0.70%) 0.059s (± 0.53%) ~ 0.058s 0.059s p=0.100 n=12
Parse Time 1.511s (± 1.33%) 1.499s (± 1.88%) ~ 1.397s 1.549s p=0.580 n=12
Bind Time 0.306s (± 0.26%) 0.318s (± 8.44%) ~ 0.303s 0.454s p=0.873 n=12
Check Time 9.334s (± 0.48%) 9.224s (± 0.86%) -0.110s (- 1.18%) 8.840s 9.288s p=0.002 n=12
Emit Time 2.794s (± 1.59%) 2.915s (± 9.37%) ~ 2.739s 4.289s p=0.378 n=12
Total Time 14.018s (± 0.23%) 14.089s (± 1.48%) ~ 13.913s 15.133s p=0.370 n=12
webpack - native
Errors 2 2 ~ ~ ~ p=1.000 n=12
Symbols 196,816 196,816 ~ ~ ~ p=1.000 n=12
Types 340 340 ~ ~ ~ p=1.000 n=12
Memory Used 230,563k (± 0.04%) 230,697k (± 0.08%) ~ 230,472k 231,283k p=0.124 n=12
Memory Allocs 973,785 (± 0.17%) 977,538 (± 0.16%) +3,753 (+ 0.39%) 974,922 982,253 p=0.005 n=12
Config Time 0.008s 0.008s ~ ~ ~ p=1.000 n=12
Parse Time 0.190s (± 2.60%) 0.192s (± 2.43%) ~ 0.177s 0.201s p=0.723 n=12
Bind Time 0s 0s ~ ~ ~ p=1.000 n=12
Check Time 0s 0s ~ ~ ~ p=1.000 n=12
Emit Time 0.056s (±13.96%) 0.056s (±10.49%) ~ 0.048s 0.080s p=0.619 n=12
Total Time 0.255s (± 2.60%) 0.257s (± 1.70%) ~ 0.240s 0.266s p=0.401 n=12
xstate-main - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 1,066,055 1,041,224 -24,831 (- 2.33%) ~ ~ p=0.000 n=12
Types 392,847 376,449 🟩-16,398 (- 4.17%) ~ ~ p=0.000 n=12
Memory Used 633,718k (± 0.01%) 617,365k (± 0.01%) -16,353k (- 2.58%) 617,171k 617,550k p=0.000 n=12
Memory Allocs 4,919,642 (± 0.04%) 4,799,205 (± 0.03%) -120,436 (- 2.45%) 4,796,119 4,803,114 p=0.000 n=12
Config Time 0.003s 0.003s ~ ~ ~ p=1.000 n=12
Parse Time 0.151s (± 3.06%) 0.149s (± 2.81%) ~ 0.139s 0.163s p=0.580 n=12
Bind Time 0.051s (±18.63%) 0.045s (±16.40%) ~ 0.034s 0.066s p=0.283 n=12
Check Time 1.281s (± 0.65%) 1.197s (± 1.03%) 🟩-0.084s (- 6.58%) 1.176s 1.239s p=0.000 n=12
Emit Time 0.001s 0.001s ~ ~ ~ p=1.000 n=12
Total Time 1.492s (± 0.75%) 1.403s (± 0.97%) 🟩-0.088s (- 5.91%) 1.377s 1.448s p=0.000 n=12
System info unknown
Hosts
  • native
Scenarios
  • Compiler-Unions - native
  • angular-1 - native
  • mui-docs - native
  • self-build-src - native
  • self-compiler - native
  • ts-pre-modules - native
  • vscode - native
  • webpack - native
  • xstate-main - native
Benchmark Name Iterations
Current pr 12
Baseline baseline 12

Developer Information:

Download Benchmarks

@jakebailey

Copy link
Copy Markdown
Member Author

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

@typescript-automation

typescript-automation Bot commented Aug 1, 2026

Copy link
Copy Markdown

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

Command Status Results
perf test this faster ✅ Started 👀 Results

@typescript-automation

Copy link
Copy Markdown

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=12
Symbols 119,733 115,452 🟩-4,281 (- 3.58%) ~ ~ p=0.000 n=12
Types 99,032 97,103 -1,929 (- 1.95%) ~ ~ p=0.000 n=12
Memory Used 150,965k (± 0.57%) 150,188k (± 0.35%) ~ 149,000k 151,500k p=0.198 n=12
Memory Allocs 2,262,945 (± 0.01%) 2,248,843 (± 0.00%) -14,101 (- 0.62%) 2,248,565 2,249,003 p=0.000 n=12
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Parse Time 0.040s (± 3.11%) 0.041s (± 3.45%) ~ 0.038s 0.045s p=0.135 n=12
Bind Time 0.012s (±13.91%) 0.013s (±13.33%) ~ 0.010s 0.019s p=0.132 n=12
Check Time 0.730s (± 0.60%) 0.502s (± 0.90%) 🟩-0.227s (-31.18%) 0.492s 0.514s p=0.000 n=12
Emit Time 0.287s (± 0.89%) 0.270s (± 2.22%) 🟩-0.017s (- 5.87%) 0.260s 0.293s p=0.000 n=12
Total Time 1.074s (± 0.46%) 0.833s (± 0.88%) 🟩-0.242s (-22.48%) 0.813s 0.851s p=0.000 n=12
angular-1 - native
Errors 3 3 ~ ~ ~ p=1.000 n=12
Symbols 872,545 (± 0.11%) 847,427 (± 0.05%) -25,119 (- 2.88%) 846,800 848,679 p=0.000 n=12
Types 263,962 (± 0.00%) 249,047 (± 0.00%) 🟩-14,915 (- 5.65%) 249,046 249,049 p=0.000 n=12
Memory Used 806,628k (± 0.05%) 794,598k (± 0.05%) -12,030k (- 1.49%) 793,928k 795,892k p=0.000 n=12
Memory Allocs 13,124,842 (± 0.12%) 13,051,568 (± 0.05%) -73,275 (- 0.56%) 13,044,393 13,078,380 p=0.000 n=12
Config Time 0.017s (± 1.86%) 0.016s (± 1.75%) ~ 0.016s 0.017s p=0.100 n=12
Parse Time 0.273s (± 2.97%) 0.278s (± 2.01%) ~ 0.259s 0.293s p=0.259 n=12
Bind Time 0.071s (±19.44%) 0.061s (± 7.60%) ~ 0.057s 0.084s p=0.107 n=12
Check Time 0s 0s ~ ~ ~ p=1.000 n=12
Emit Time 1.711s (± 1.27%) 1.673s (± 1.02%) -0.038s (- 2.21%) 1.645s 1.746s p=0.001 n=12
Total Time 2.084s (± 1.62%) 2.047s (± 1.04%) -0.037s (- 1.76%) 2.022s 2.141s p=0.008 n=12
mui-docs - native
Errors 11,275 (± 0.05%) 11,277 (± 0.04%) ~ 11,262 11,282 p=0.557 n=12
Symbols 4,387,605 4,033,914 🟩-353,691 (- 8.06%) ~ ~ p=0.000 n=12
Types 1,540,346 1,575,142 +34,796 (+ 2.26%) ~ ~ p=0.000 n=12
Memory Used 4,965,848k (± 0.03%) 4,173,765k (± 0.04%) 🟩-792,082k (-15.95%) 4,168,880k 4,177,077k p=0.000 n=12
Memory Allocs 45,317,685 (± 0.04%) 45,942,716 (± 0.04%) +625,031 (+ 1.38%) 45,890,771 45,972,825 p=0.000 n=12
Config Time 0.016s 0.016s (± 1.81%) ~ 0.015s 0.016s p=0.217 n=12
Parse Time 0.550s (± 2.69%) 0.552s (± 2.22%) ~ 0.521s 0.582s p=0.877 n=12
Bind Time 0.002s 0.002s ~ ~ ~ p=1.000 n=12
Check Time 16.297s (± 0.50%) 14.798s (± 0.28%) 🟩-1.500s (- 9.20%) 14.739s 14.919s p=0.000 n=12
Emit Time 0.456s (± 2.69%) 0.440s (± 2.15%) 🟩-0.016s (- 3.51%) 0.430s 0.475s p=0.002 n=12
Total Time 18.028s (± 0.49%) 16.544s (± 0.21%) 🟩-1.484s (- 8.23%) 16.469s 16.656s p=0.000 n=12
self-build-src - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 1,394,491 1,392,292 -2,199 (- 0.16%) ~ ~ p=0.000 n=12
Types 442,212 443,118 +906 (+ 0.20%) ~ ~ p=0.000 n=12
Memory Used 1,633,226k (± 0.29%) 1,638,195k (± 0.40%) ~ 1,618,093k 1,658,996k p=0.198 n=12
Memory Allocs 97,045,521 (± 0.03%) 96,721,634 (± 0.05%) -323,888 (- 0.33%) 96,618,086 96,844,622 p=0.000 n=12
Config Time 0.003s (± 7.73%) 0.003s (±12.31%) ~ 0.002s 0.004s p=0.193 n=12
Parse Time 0.200s (± 2.45%) 0.195s (± 2.86%) ~ 0.182s 0.209s p=0.213 n=12
Bind Time 0.001s (±217.90%) 0.000s ~ ~ ~ p=1.000 n=12
Check Time 2.034s (± 0.38%) 1.853s (± 0.35%) 🟩-0.180s (- 8.87%) 1.835s 1.868s p=0.000 n=12
Emit Time 0.299s (± 5.29%) 0.307s (± 4.37%) ~ 0.278s 0.337s p=0.401 n=12
Total Time 27.375s (± 0.70%) 25.316s (± 0.76%) 🟩-2.059s (- 7.52%) 24.981s 25.988s p=0.000 n=12
self-compiler - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 337,834 338,124 +290 (+ 0.09%) ~ ~ p=0.000 n=12
Types 199,561 198,606 -955 (- 0.48%) ~ ~ p=0.000 n=12
Memory Used 318,352k (± 0.03%) 319,869k (± 0.08%) +1,517k (+ 0.48%) 319,522k 321,013k p=0.000 n=12
Memory Allocs 4,659,281 (± 0.01%) 4,660,849 (± 0.01%) +1,568 (+ 0.03%) 4,659,954 4,662,012 p=0.000 n=12
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=12
Parse Time 0.113s (± 4.61%) 0.119s (± 3.63%) ~ 0.109s 0.127s p=0.070 n=12
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Check Time 1.220s (± 0.62%) 1.059s (± 0.67%) 🟩-0.160s (-13.12%) 1.040s 1.075s p=0.000 n=12
Emit Time 0.158s (± 6.66%) 0.160s (± 6.71%) ~ 0.126s 0.186s p=0.561 n=12
Total Time 1.546s (± 0.93%) 1.393s (± 0.70%) 🟩-0.153s (- 9.90%) 1.370s 1.416s p=0.000 n=12
ts-pre-modules - native
Errors 87 87 ~ ~ ~ p=1.000 n=12
Symbols 302,246 305,220 +2,974 (+ 0.98%) ~ ~ p=0.000 n=12
Types 181,594 181,907 +313 (+ 0.17%) ~ ~ p=0.000 n=12
Memory Used 274,419k (± 0.01%) 277,645k (± 0.02%) +3,226k (+ 1.18%) 277,507k 277,743k p=0.000 n=12
Memory Allocs 1,661,137 (± 0.01%) 1,625,633 (± 0.01%) -35,504 (- 2.14%) 1,625,249 1,626,188 p=0.000 n=12
Config Time 0.000s (±92.91%) 0.000s ~ ~ ~ p=0.093 n=12
Parse Time 0.101s (± 3.85%) 0.099s (± 6.13%) ~ 0.087s 0.112s p=0.660 n=12
Bind Time 0.038s (±12.49%) 0.039s (± 8.40%) ~ 0.030s 0.049s p=0.400 n=12
Check Time 0.995s (± 0.66%) 0.834s (± 0.77%) 🟩-0.161s (-16.17%) 0.821s 0.850s p=0.000 n=12
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Total Time 1.147s (± 0.67%) 0.988s (± 0.84%) 🟩-0.159s (-13.87%) 0.971s 1.018s p=0.000 n=12
vscode - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 7,631,101 7,149,324 🟩-481,777 (- 6.31%) ~ ~ p=0.000 n=12
Types 2,654,831 2,453,001 🟩-201,830 (- 7.60%) ~ ~ p=0.000 n=12
Memory Used 5,084,004k (± 0.02%) 4,857,161k (± 0.02%) 🟩-226,843k (- 4.46%) 4,855,500k 4,859,871k p=0.000 n=12
Memory Allocs 38,635,097 (± 0.02%) 37,459,209 (± 0.02%) 🟩-1,175,888 (- 3.04%) 37,448,116 37,481,407 p=0.000 n=12
Config Time 0.058s (± 0.62%) 0.059s (± 0.62%) +0.001s (+ 1.15%) 0.058s 0.060s p=0.023 n=12
Parse Time 1.500s (± 1.83%) 1.489s (± 2.01%) ~ 1.390s 1.561s p=0.434 n=12
Bind Time 0.321s (± 9.79%) 0.331s (±10.97%) ~ 0.305s 0.480s p=0.127 n=12
Check Time 9.710s (± 0.83%) 8.833s (± 1.31%) 🟩-0.877s (- 9.03%) 8.436s 8.927s p=0.000 n=12
Emit Time 2.919s (± 8.66%) 2.913s (± 8.83%) -0.006s (- 0.20%) 2.697s 3.825s p=0.018 n=12
Total Time 14.523s (± 1.29%) 13.703s (± 1.18%) 🟩-0.819s (- 5.64%) 13.520s 14.289s p=0.000 n=12
webpack - native
Errors 2 2 ~ ~ ~ p=1.000 n=12
Symbols 196,816 196,816 ~ ~ ~ p=1.000 n=12
Types 340 340 ~ ~ ~ p=1.000 n=12
Memory Used 230,664k (± 0.08%) 230,577k (± 0.08%) ~ 230,033k 231,053k p=0.410 n=12
Memory Allocs 975,105 (± 0.26%) 977,979 (± 0.23%) +2,875 (+ 0.29%) 974,026 985,698 p=0.020 n=12
Config Time 0.008s (± 3.45%) 0.009s (± 6.68%) ~ 0.008s 0.010s p=0.126 n=12
Parse Time 0.203s (± 2.95%) 0.200s (± 2.20%) ~ 0.187s 0.209s p=0.270 n=12
Bind Time 0s 0s ~ ~ ~ p=1.000 n=12
Check Time 0s 0s ~ ~ ~ p=1.000 n=12
Emit Time 0.060s (±16.77%) 0.057s (± 8.51%) ~ 0.050s 0.079s p=0.296 n=12
Total Time 0.271s (± 2.42%) 0.266s (± 1.80%) ~ 0.250s 0.277s p=0.248 n=12
xstate-main - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 1,066,055 1,041,224 -24,831 (- 2.33%) ~ ~ p=0.000 n=12
Types 392,847 376,449 🟩-16,398 (- 4.17%) ~ ~ p=0.000 n=12
Memory Used 633,793k (± 0.02%) 617,384k (± 0.01%) -16,409k (- 2.59%) 617,106k 617,545k p=0.000 n=12
Memory Allocs 4,917,954 (± 0.03%) 4,798,032 (± 0.03%) -119,921 (- 2.44%) 4,794,966 4,802,324 p=0.000 n=12
Config Time 0.003s 0.003s ~ ~ ~ p=1.000 n=12
Parse Time 0.151s (± 3.56%) 0.150s (± 2.74%) ~ 0.143s 0.161s p=0.723 n=12
Bind Time 0.057s (±14.02%) 0.047s (±18.04%) ~ 0.035s 0.072s p=0.091 n=12
Check Time 1.277s (± 0.34%) 1.190s (± 0.52%) 🟩-0.087s (- 6.81%) 1.179s 1.205s p=0.000 n=12
Emit Time 0.001s 0.001s ~ ~ ~ p=1.000 n=12
Total Time 1.496s (± 0.36%) 1.399s (± 0.44%) 🟩-0.097s (- 6.49%) 1.384s 1.415s p=0.000 n=12
System info unknown
Hosts
  • native
Scenarios
  • Compiler-Unions - native
  • angular-1 - native
  • mui-docs - native
  • self-build-src - native
  • self-compiler - native
  • ts-pre-modules - native
  • vscode - native
  • webpack - native
  • xstate-main - native
Benchmark Name Iterations
Current pr 12
Baseline baseline 12

Developer Information:

Download Benchmarks

@walkerdb

Copy link
Copy Markdown
Contributor

Tested this on our large monorepo (~17M lines of TS) -- seems to be a great improvement!

Both runs were with #4309 reverted since it causes a major ram regression.

Before

~2m 15s
max ram reported by gtime : ~58gb

After

~2m 1s
max ram: ~53gb

so ~10% faster and 10% more efficient ram use, love it!

@jakebailey

Copy link
Copy Markdown
Member Author

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

@typescript-automation

typescript-automation Bot commented Aug 5, 2026

Copy link
Copy Markdown

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

Command Status Results
perf test this faster ✅ Started 👀 Results

@typescript-automation

Copy link
Copy Markdown

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=12
Symbols 119,733 115,452 🟩-4,281 (- 3.58%) ~ ~ p=0.000 n=12
Types 99,032 97,103 -1,929 (- 1.95%) ~ ~ p=0.000 n=12
Memory Used 151,045k (± 0.52%) 149,237k (± 0.53%) -1,808k (- 1.20%) 147,579k 151,999k p=0.002 n=12
Memory Allocs 2,263,015 (± 0.01%) 2,248,856 (± 0.00%) -14,159 (- 0.63%) 2,248,584 2,249,094 p=0.000 n=12
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Parse Time 0.050s (± 3.47%) 0.052s (± 2.41%) ~ 0.049s 0.055s p=0.417 n=12
Bind Time 0.017s (±10.60%) 0.015s (±12.07%) ~ 0.013s 0.021s p=0.164 n=12
Check Time 0.879s (± 0.79%) 0.613s (± 0.74%) 🟩-0.266s (-30.25%) 0.605s 0.626s p=0.000 n=12
Emit Time 0.345s (± 1.73%) 0.328s (± 2.45%) 🟩-0.017s (- 4.90%) 0.311s 0.352s p=0.002 n=12
Total Time 1.298s (± 0.57%) 1.016s (± 1.09%) 🟩-0.282s (-21.73%) 0.993s 1.049s p=0.000 n=12
angular-1 - native
Errors 3 3 ~ ~ ~ p=1.000 n=12
Symbols 872,563 (± 0.09%) 847,547 (± 0.05%) -25,015 (- 2.87%) 846,881 848,982 p=0.000 n=12
Types 263,962 (± 0.00%) 249,048 (± 0.00%) 🟩-14,914 (- 5.65%) 249,046 249,052 p=0.000 n=12
Memory Used 807,003k (± 0.06%) 794,967k (± 0.06%) -12,036k (- 1.49%) 793,687k 796,443k p=0.000 n=12
Memory Allocs 13,116,015 (± 0.04%) 13,045,272 (± 0.04%) -70,744 (- 0.54%) 13,040,888 13,065,428 p=0.000 n=12
Config Time 0.017s (± 1.45%) 0.016s (± 1.75%) 🟩-0.001s (- 3.47%) 0.016s 0.017s p=0.012 n=12
Parse Time 0.273s (± 2.73%) 0.278s (± 2.34%) ~ 0.264s 0.298s p=0.202 n=12
Bind Time 0.067s (±14.62%) 0.063s (± 9.80%) ~ 0.058s 0.088s p=0.797 n=12
Check Time 0s 0s ~ ~ ~ p=1.000 n=12
Emit Time 1.715s (± 1.69%) 1.681s (± 1.17%) ~ 1.643s 1.745s p=0.086 n=12
Total Time 2.089s (± 1.66%) 2.056s (± 1.28%) ~ 2.013s 2.139s p=0.124 n=12
mui-docs - native
Errors 11,279 (± 0.03%) 11,277 (± 0.03%) ~ 11,267 11,282 p=0.124 n=12
Symbols 4,388,468 4,030,774 🟩-357,694 (- 8.15%) ~ ~ p=0.000 n=12
Types 1,540,625 1,571,460 +30,835 (+ 2.00%) ~ ~ p=0.000 n=12
Memory Used 4,965,762k (± 0.04%) 4,169,279k (± 0.03%) 🟩-796,482k (-16.04%) 4,166,998k 4,173,540k p=0.000 n=12
Memory Allocs 45,308,264 (± 0.05%) 45,960,154 (± 0.04%) +651,891 (+ 1.44%) 45,922,652 46,007,528 p=0.000 n=12
Config Time 0.016s 0.016s (± 1.14%) ~ 0.015s 0.016s p=1.000 n=12
Parse Time 0.549s (± 2.28%) 0.563s (± 1.37%) ~ 0.542s 0.578s p=0.091 n=12
Bind Time 0.002s 0.002s ~ ~ ~ p=1.000 n=12
Check Time 16.296s (± 0.54%) 14.762s (± 0.37%) 🟩-1.534s (- 9.41%) 14.652s 14.903s p=0.000 n=12
Emit Time 0.453s (± 2.54%) 0.439s (± 1.88%) 🟩-0.014s (- 3.20%) 0.430s 0.471s p=0.004 n=12
Total Time 18.038s (± 0.55%) 16.522s (± 0.17%) 🟩-1.516s (- 8.41%) 16.463s 16.607s p=0.000 n=12
self-build-src - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 1,394,491 1,392,292 -2,199 (- 0.16%) ~ ~ p=0.000 n=12
Types 442,212 443,118 +906 (+ 0.20%) ~ ~ p=0.000 n=12
Memory Used 1,633,414k (± 0.29%) 1,638,192k (± 0.29%) ~ 1,622,367k 1,647,396k p=0.089 n=12
Memory Allocs 97,054,210 (± 0.04%) 96,738,537 (± 0.04%) -315,673 (- 0.33%) 96,627,762 96,816,372 p=0.000 n=12
Config Time 0.003s (±14.59%) 0.003s (±14.26%) ~ 0.002s 0.004s p=0.874 n=12
Parse Time 0.202s (± 2.66%) 0.196s (± 2.96%) ~ 0.179s 0.210s p=0.131 n=12
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Check Time 2.030s (± 0.40%) 1.859s (± 0.48%) 🟩-0.171s (- 8.41%) 1.840s 1.891s p=0.000 n=12
Emit Time 0.307s (± 4.55%) 0.310s (± 5.30%) ~ 0.271s 0.365s p=0.898 n=12
Total Time 27.303s (± 0.64%) 25.539s (± 0.87%) 🟩-1.764s (- 6.46%) 25.092s 26.032s p=0.000 n=12
self-compiler - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 337,834 338,124 +290 (+ 0.09%) ~ ~ p=0.000 n=12
Types 199,561 198,606 -955 (- 0.48%) ~ ~ p=0.000 n=12
Memory Used 318,299k (± 0.04%) 319,805k (± 0.02%) +1,505k (+ 0.47%) 319,630k 320,048k p=0.000 n=12
Memory Allocs 4,658,898 (± 0.01%) 4,660,777 (± 0.01%) +1,880 (+ 0.04%) 4,659,139 4,661,775 p=0.000 n=12
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=12
Parse Time 0.095s (± 4.51%) 0.095s (± 6.73%) ~ 0.084s 0.118s p=0.809 n=12
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Check Time 1.011s (± 0.73%) 0.881s (± 0.61%) 🟩-0.129s (-12.79%) 0.869s 0.896s p=0.000 n=12
Emit Time 0.122s (±11.72%) 0.119s (±11.09%) ~ 0.085s 0.148s p=0.743 n=12
Total Time 1.274s (± 0.72%) 1.137s (± 0.81%) 🟩-0.137s (-10.75%) 1.114s 1.163s p=0.000 n=12
ts-pre-modules - native
Errors 87 87 ~ ~ ~ p=1.000 n=12
Symbols 302,246 305,220 +2,974 (+ 0.98%) ~ ~ p=0.000 n=12
Types 181,594 181,907 +313 (+ 0.17%) ~ ~ p=0.000 n=12
Memory Used 274,454k (± 0.03%) 277,590k (± 0.01%) +3,136k (+ 1.14%) 277,478k 277,735k p=0.000 n=12
Memory Allocs 1,661,296 (± 0.02%) 1,625,598 (± 0.01%) -35,699 (- 2.15%) 1,625,284 1,626,159 p=0.000 n=12
Config Time 0.000s (±217.90%) 0.000s ~ ~ ~ p=1.000 n=12
Parse Time 0.098s (± 4.16%) 0.100s (± 3.24%) ~ 0.090s 0.110s p=0.400 n=12
Bind Time 0.033s (± 7.84%) 0.041s (±10.64%) 🔻+0.008s (+23.23%) 0.030s 0.052s p=0.003 n=12
Check Time 0.986s (± 0.60%) 0.843s (± 0.73%) 🟩-0.142s (-14.46%) 0.824s 0.855s p=0.000 n=12
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Total Time 1.131s (± 0.54%) 0.999s (± 0.62%) 🟩-0.132s (-11.65%) 0.978s 1.015s p=0.000 n=12
vscode - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 7,759,212 7,335,509 🟩-423,703 (- 5.46%) ~ ~ p=0.000 n=12
Types 2,706,958 2,541,427 🟩-165,531 (- 6.12%) ~ ~ p=0.000 n=12
Memory Used 5,169,826k (± 0.02%) 4,967,636k (± 0.02%) 🟩-202,191k (- 3.91%) 4,966,102k 4,970,383k p=0.000 n=12
Memory Allocs 39,409,737 (± 0.02%) 38,589,165 (± 0.02%) -820,572 (- 2.08%) 38,575,470 38,624,834 p=0.000 n=12
Config Time 0.059s (± 0.55%) 0.060s (± 0.83%) ~ 0.059s 0.061s p=0.237 n=12
Parse Time 1.523s (± 1.48%) 1.498s (± 1.18%) ~ 1.457s 1.548s p=0.058 n=12
Bind Time 0.312s (± 0.69%) 0.311s (± 0.29%) ~ 0.309s 0.315s p=0.833 n=12
Check Time 9.495s (± 0.27%) 9.184s (± 0.43%) 🟩-0.311s (- 3.27%) 9.008s 9.249s p=0.000 n=12
Emit Time 2.831s (± 0.72%) 2.797s (± 3.04%) -0.034s (- 1.19%) 2.722s 3.221s p=0.000 n=12
Total Time 14.236s (± 0.23%) 13.925s (± 0.39%) -0.310s (- 2.18%) 13.832s 14.175s p=0.000 n=12
webpack - native
Errors 2 2 ~ ~ ~ p=1.000 n=12
Symbols 212,840 212,840 ~ ~ ~ p=1.000 n=12
Types 340 340 ~ ~ ~ p=1.000 n=12
Memory Used 242,939k (± 0.06%) 242,954k (± 0.10%) ~ 242,544k 243,900k p=0.843 n=12
Memory Allocs 1,003,581 (± 0.22%) 1,008,093 (± 0.17%) +4,512 (+ 0.45%) 1,005,022 1,013,313 p=0.017 n=12
Config Time 0.008s 0.008s ~ ~ ~ p=1.000 n=12
Parse Time 0.203s (± 1.68%) 0.198s (± 2.52%) ~ 0.183s 0.212s p=0.075 n=12
Bind Time 0s 0s ~ ~ ~ p=1.000 n=12
Check Time 0s 0s ~ ~ ~ p=1.000 n=12
Emit Time 0.054s (±12.27%) 0.058s (±10.58%) 🔻+0.004s (+ 7.41%) 0.048s 0.083s p=0.049 n=12
Total Time 0.265s (± 2.42%) 0.264s (± 2.22%) ~ 0.248s 0.283s p=0.966 n=12
xstate-main - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 1,050,048 1,021,589 -28,459 (- 2.71%) ~ ~ p=0.000 n=12
Types 394,542 375,728 🟩-18,814 (- 4.77%) ~ ~ p=0.000 n=12
Memory Used 620,370k (± 0.01%) 605,100k (± 0.01%) -15,270k (- 2.46%) 604,919k 605,320k p=0.000 n=12
Memory Allocs 4,894,832 (± 0.02%) 4,734,755 (± 0.06%) 🟩-160,078 (- 3.27%) 4,730,306 4,742,745 p=0.000 n=12
Config Time 0.003s (± 6.23%) 0.003s (± 6.23%) ~ 0.002s 0.003s p=1.000 n=12
Parse Time 0.141s (± 2.12%) 0.143s (± 4.05%) ~ 0.134s 0.165s p=0.743 n=12
Bind Time 0.049s (±15.11%) 0.044s (±14.18%) ~ 0.033s 0.060s p=0.450 n=12
Check Time 1.268s (± 0.46%) 1.102s (± 0.81%) 🟩-0.165s (-13.05%) 1.077s 1.120s p=0.000 n=12
Emit Time 0.001s 0.001s ~ ~ ~ p=1.000 n=12
Total Time 1.471s (± 0.70%) 1.304s (± 1.05%) 🟩-0.166s (-11.30%) 1.270s 1.330s p=0.000 n=12
System info unknown
Hosts
  • native
Scenarios
  • Compiler-Unions - native
  • angular-1 - native
  • mui-docs - native
  • self-build-src - native
  • self-compiler - native
  • ts-pre-modules - native
  • vscode - native
  • webpack - native
  • xstate-main - native
Benchmark Name Iterations
Current pr 12
Baseline baseline 12

Developer Information:

Download Benchmarks

@jakebailey

Copy link
Copy Markdown
Member Author

I tested the method from #4856 and it was worse; the FENNEL approach here does a better job across workloads, mui, etc.

@jakebailey Jake Bailey (jakebailey) changed the title Assign checkers with cost/import-aware algorithm Assign files to checkers using balanced import affinity Aug 10, 2026
@RyanCavanaugh

Copy link
Copy Markdown
Member

It looks like Copilot did a parameter sweep for all the constant factors except this one - give it a go?

const checkerAssociationTextWeightDivisor = 100

Code LGTM, I like how isolated this is

@jakebailey

Copy link
Copy Markdown
Member Author

It did actually sweep that; I did just have it retry and 100 is still the best in what projects I have.

@jakebailey
Jake Bailey (jakebailey) marked this pull request as ready for review August 12, 2026 18:52
@jakebailey

Copy link
Copy Markdown
Member Author

I will let it update some comments afterward, though, so will probably push soon when it's done benchmarking

@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit dcfc50b Aug 13, 2026
37 of 39 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the jabaile/checker-association-only branch August 13, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants