Skip to content

Port "Improve type discrimination algorithm" from tsgo #61828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakebailey
Copy link
Member

Porting microsoft/typescript-go#1085 for testing.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jun 7, 2025
@jakebailey
Copy link
Member Author

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 7, 2025

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

Command Status Results
test top400 ✅ Started ✅ Results
user test this ✅ Started ✅ Results
run dt ✅ Started ✅ Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/61828/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

@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 - node (v18.15.0, x64)
Errors 34 34 ~ ~ ~ p=1.000 n=6
Symbols 62,390 62,390 ~ ~ ~ p=1.000 n=6
Types 50,395 50,395 ~ ~ ~ p=1.000 n=6
Memory used 194,193k (± 0.99%) 193,587k (± 0.74%) ~ 192,911k 196,515k p=0.336 n=6
Parse Time 1.31s (± 0.94%) 1.30s (± 1.02%) ~ 1.29s 1.32s p=0.729 n=6
Bind Time 0.73s 0.73s ~ ~ ~ p=1.000 n=6
Check Time 9.72s (± 0.34%) 9.72s (± 0.33%) ~ 9.68s 9.75s p=0.871 n=6
Emit Time 2.74s (± 0.63%) 2.74s (± 0.67%) ~ 2.71s 2.76s p=0.935 n=6
Total Time 14.49s (± 0.26%) 14.49s (± 0.28%) ~ 14.44s 14.55s p=0.871 n=6
angular-1 - node (v18.15.0, x64)
Errors 56 56 ~ ~ ~ p=1.000 n=6
Symbols 949,249 949,301 +52 (+ 0.01%) ~ ~ p=0.001 n=6
Types 411,061 411,047 -14 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 1,225,134k (± 0.01%) 1,225,182k (± 0.01%) ~ 1,225,073k 1,225,291k p=0.378 n=6
Parse Time 6.60s (± 0.79%) 6.62s (± 0.41%) ~ 6.60s 6.67s p=0.935 n=6
Bind Time 1.88s (± 0.22%) 1.88s (± 0.67%) ~ 1.87s 1.90s p=0.930 n=6
Check Time 31.97s (± 0.28%) 31.94s (± 0.47%) ~ 31.77s 32.10s p=0.810 n=6
Emit Time 14.85s (± 0.31%) 14.88s (± 0.30%) ~ 14.82s 14.92s p=0.229 n=6
Total Time 55.29s (± 0.15%) 55.32s (± 0.35%) ~ 55.08s 55.56s p=0.748 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,576,529 2,576,529 ~ ~ ~ p=1.000 n=6
Types 892,130 892,131 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,856,921k (± 0.00%) 2,856,927k (± 0.00%) ~ 2,856,871k 2,856,977k p=0.873 n=6
Parse Time 9.08s (± 0.16%) 9.10s (± 0.54%) ~ 9.04s 9.18s p=0.571 n=6
Bind Time 2.29s (± 0.45%) 2.29s (± 0.36%) ~ 2.27s 2.29s p=1.000 n=6
Check Time 87.32s (± 0.51%) 87.31s (± 0.49%) ~ 86.75s 87.71s p=0.810 n=6
Emit Time 0.30s (± 1.37%) 0.30s (± 1.37%) ~ 0.29s 0.30s p=1.000 n=6
Total Time 98.98s (± 0.44%) 99.00s (± 0.48%) ~ 98.35s 99.42s p=0.936 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 2 🔻+2 (+ ∞%) ~ ~ p=0.001 n=6
Symbols 1,228,901 1,294,261 🔻+65,360 (+ 5.32%) ~ ~ p=0.001 n=6
Types 267,535 267,636 +101 (+ 0.04%) ~ ~ p=0.001 n=6
Memory used 2,361,874k (± 0.02%) 2,516,279k (± 0.02%) 🔻+154,405k (+ 6.54%) 2,515,472k 2,516,733k p=0.005 n=6
Parse Time 5.20s (± 0.87%) 6.80s (± 0.42%) 🔻+1.60s (+30.84%) 6.77s 6.84s p=0.005 n=6
Bind Time 1.81s (± 0.57%) 2.55s (± 0.32%) 🔻+0.74s (+40.81%) 2.54s 2.56s p=0.004 n=6
Check Time 35.49s (± 0.42%) 35.47s (± 0.23%) ~ 35.34s 35.56s p=0.689 n=6
Emit Time 3.03s (± 2.68%) 2.97s (± 0.59%) ~ 2.96s 3.00s p=0.146 n=6
Total Time 45.55s (± 0.45%) 47.81s (± 0.20%) 🔻+2.26s (+ 4.97%) 47.65s 47.91s p=0.005 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 2 🔻+2 (+ ∞%) ~ ~ p=0.001 n=6
Symbols 1,228,901 1,294,261 🔻+65,360 (+ 5.32%) ~ ~ p=0.001 n=6
Types 267,535 267,636 +101 (+ 0.04%) ~ ~ p=0.001 n=6
Memory used 3,041,141k (± 9.82%) 2,834,586k (±13.30%) ~ 2,588,798k 3,321,773k p=0.810 n=6
Parse Time 6.91s (± 1.21%) 8.77s (± 0.96%) 🔻+1.86s (+26.90%) 8.67s 8.91s p=0.005 n=6
Bind Time 2.20s (± 2.06%) 3.07s (± 0.90%) 🔻+0.87s (+39.65%) 3.03s 3.11s p=0.005 n=6
Check Time 43.03s (± 0.54%) 42.95s (± 0.55%) ~ 42.63s 43.30s p=0.471 n=6
Emit Time 3.47s (± 2.34%) 3.53s (± 4.65%) ~ 3.36s 3.75s p=0.810 n=6
Total Time 55.60s (± 0.45%) 58.32s (± 0.58%) 🔻+2.72s (+ 4.90%) 57.90s 58.84s p=0.005 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 263,517 263,517 ~ ~ ~ p=1.000 n=6
Types 107,246 107,248 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 442,131k (± 0.01%) 442,122k (± 0.02%) ~ 442,047k 442,237k p=0.810 n=6
Parse Time 3.53s (± 0.58%) 3.53s (± 1.00%) ~ 3.50s 3.60s p=0.871 n=6
Bind Time 1.32s (± 1.17%) 1.33s (± 0.57%) ~ 1.32s 1.34s p=0.404 n=6
Check Time 18.96s (± 0.20%) 19.02s (± 0.44%) ~ 18.88s 19.12s p=0.148 n=6
Emit Time 1.52s (± 0.80%) 1.52s (± 0.72%) ~ 1.51s 1.54s p=0.739 n=6
Total Time 25.33s (± 0.23%) 25.39s (± 0.42%) ~ 25.21s 25.52s p=0.127 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 71 71 ~ ~ ~ p=1.000 n=6
Symbols 225,981 225,981 ~ ~ ~ p=1.000 n=6
Types 94,356 94,358 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 371,347k (± 0.03%) 371,444k (± 0.06%) ~ 371,244k 371,814k p=0.810 n=6
Parse Time 2.90s (± 0.72%) 2.88s (± 1.34%) ~ 2.82s 2.94s p=0.466 n=6
Bind Time 1.60s (± 1.46%) 1.59s (± 1.42%) ~ 1.56s 1.61s p=0.415 n=6
Check Time 16.48s (± 0.31%) 16.47s (± 0.54%) ~ 16.35s 16.60s p=0.936 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.99s (± 0.22%) 20.94s (± 0.33%) ~ 20.85s 21.06s p=0.227 n=6
vscode - node (v18.15.0, x64)
Errors 38 38 ~ ~ ~ p=1.000 n=6
Symbols 3,495,853 3,495,854 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 1,180,300 1,180,350 +50 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,537,292k (± 0.00%) 3,537,503k (± 0.01%) ~ 3,536,893k 3,538,175k p=0.173 n=6
Parse Time 14.98s (± 0.67%) 14.99s (± 0.30%) ~ 14.93s 15.04s p=0.936 n=6
Bind Time 4.89s (± 0.86%) 4.86s (± 0.50%) ~ 4.81s 4.88s p=0.122 n=6
Check Time 97.43s (± 3.52%) 95.48s (± 1.55%) ~ 94.23s 97.53s p=0.471 n=6
Emit Time 32.24s (±14.15%) 30.59s (± 8.24%) ~ 29.18s 35.60s p=0.128 n=6
Total Time 149.54s (± 3.85%) 145.91s (± 2.57%) ~ 143.27s 152.63s p=0.298 n=6
webpack - node (v18.15.0, x64)
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 320,092 320,092 ~ ~ ~ p=1.000 n=6
Types 140,399 140,403 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 474,330k (± 0.03%) 474,396k (± 0.02%) ~ 474,254k 474,521k p=0.378 n=6
Parse Time 4.33s (± 1.04%) 4.32s (± 0.48%) ~ 4.30s 4.36s p=0.872 n=6
Bind Time 1.77s (± 1.49%) 1.77s (± 1.17%) ~ 1.73s 1.79s p=0.935 n=6
Check Time 20.80s (± 0.45%) 20.78s (± 0.63%) ~ 20.64s 20.94s p=0.748 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 26.90s (± 0.43%) 26.88s (± 0.50%) ~ 26.71s 27.04s p=0.688 n=6
xstate-main - node (v18.15.0, x64)
Errors 5 35 🔻+30 (+600.00%) ~ ~ p=0.001 n=6
Symbols 560,615 560,725 +110 (+ 0.02%) ~ ~ p=0.001 n=6
Types 191,464 191,950 +486 (+ 0.25%) ~ ~ p=0.001 n=6
Memory used 498,464k (± 0.03%) 499,007k (± 0.01%) +544k (+ 0.11%) 498,957k 499,051k p=0.005 n=6
Parse Time 3.44s (± 0.89%) 3.43s (± 0.86%) ~ 3.39s 3.46s p=0.872 n=6
Bind Time 1.24s (± 1.10%) 1.23s (± 1.58%) ~ 1.20s 1.25s p=0.440 n=6
Check Time 19.71s (± 1.42%) 19.57s (± 0.36%) ~ 19.48s 19.68s p=0.258 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.39s (± 1.25%) 24.23s (± 0.26%) ~ 24.17s 24.31s p=0.260 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparing main and refs/pull/61828/merge:

Everything looks good!

@jakebailey
Copy link
Member Author

Despite the above, xstate has 30 new errors.

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