TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Infer from annotated parameters of context sensitive functions in the first inference pass

Open Andarist opened this issue 2 years ago • 12 comments

fixes https://github.com/microsoft/TypeScript/issues/56459 fixes https://github.com/microsoft/TypeScript/issues/60047 fixes https://github.com/microsoft/TypeScript/issues/60648

Andarist avatar Nov 19 '23 10:11 Andarist

@jakebailey could you run the extended test suite here? :)

Andarist avatar Sep 24 '24 16:09 Andarist

@typescript-bot test it

jakebailey avatar Sep 24 '24 17:09 jakebailey

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 avatar Sep 24 '24 17:09 typescript-bot

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

Everything looks the same!

You can check the log here.

typescript-bot avatar Sep 24 '24 17:09 typescript-bot

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

Everything looks good!

typescript-bot avatar Sep 24 '24 17:09 typescript-bot

@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 30 30 ~ ~ ~ p=1.000 n=6
Symbols 62,340 62,340 ~ ~ ~ p=1.000 n=6
Types 50,378 50,378 ~ ~ ~ p=1.000 n=6
Memory used 193,997k (± 0.90%) 195,147k (± 0.90%) ~ 192,687k 196,341k p=0.298 n=6
Parse Time 1.57s (± 1.19%) 1.57s (± 0.40%) ~ 1.56s 1.58s p=0.677 n=6
Bind Time 0.86s (± 0.60%) 0.86s (± 1.20%) ~ 0.85s 0.87s p=0.204 n=6
Check Time 11.38s (± 0.28%) 11.35s (± 0.38%) ~ 11.28s 11.40s p=0.414 n=6
Emit Time 3.24s (± 1.09%) 3.25s (± 0.81%) ~ 3.21s 3.28s p=0.747 n=6
Total Time 17.05s (± 0.33%) 17.04s (± 0.15%) ~ 17.00s 17.08s p=1.000 n=6
angular-1 - node (v18.15.0, x64)
Errors 7 7 ~ ~ ~ p=1.000 n=6
Symbols 947,102 947,104 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Types 410,738 410,744 +6 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 1,224,025k (± 0.00%) 1,223,983k (± 0.00%) ~ 1,223,925k 1,224,065k p=0.128 n=6
Parse Time 6.60s (± 0.54%) 6.59s (± 0.78%) ~ 6.54s 6.67s p=0.422 n=6
Bind Time 1.87s (± 0.22%) 1.87s ~ ~ ~ p=0.405 n=6
Check Time 31.28s (± 0.31%) 31.34s (± 0.12%) ~ 31.29s 31.38s p=0.376 n=6
Emit Time 15.07s (± 0.76%) 15.04s (± 0.44%) ~ 14.95s 15.12s p=0.748 n=6
Total Time 54.82s (± 0.25%) 54.83s (± 0.14%) ~ 54.72s 54.91s p=1.000 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,521,651 2,521,572 -79 (- 0.00%) ~ ~ p=0.001 n=6
Types 936,037 936,022 -15 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 2,351,741k (± 0.00%) 2,351,774k (± 0.00%) ~ 2,351,703k 2,351,859k p=0.298 n=6
Parse Time 9.29s (± 0.24%) 9.28s (± 0.33%) ~ 9.24s 9.32s p=0.518 n=6
Bind Time 2.14s (± 0.42%) 2.14s (± 0.35%) ~ 2.13s 2.15s p=0.798 n=6
Check Time 73.38s (± 0.66%) 73.55s (± 0.41%) ~ 73.02s 73.79s p=0.378 n=6
Emit Time 0.28s (± 2.70%) 0.27s (± 2.77%) ~ 0.26s 0.28s p=0.195 n=6
Total Time 85.09s (± 0.57%) 85.24s (± 0.38%) ~ 84.68s 85.51s p=0.470 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,249,990 1,249,995 +5 (+ 0.00%) ~ ~ p=0.001 n=6
Types 264,937 264,936 -1 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 2,403,943k (± 0.04%) 2,404,184k (± 0.04%) ~ 2,403,094k 2,405,323k p=0.936 n=6
Parse Time 5.14s (± 0.87%) 5.10s (± 0.95%) ~ 5.05s 5.18s p=0.126 n=6
Bind Time 1.90s (± 0.72%) 1.90s (± 0.43%) ~ 1.89s 1.91s p=0.933 n=6
Check Time 34.90s (± 0.46%) 35.00s (± 0.43%) ~ 34.90s 35.30s p=0.126 n=6
Emit Time 3.06s (± 5.00%) 3.05s (± 4.75%) ~ 2.93s 3.26s p=0.809 n=6
Total Time 45.02s (± 0.52%) 45.08s (± 0.40%) ~ 44.85s 45.33s p=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,249,990 1,249,995 +5 (+ 0.00%) ~ ~ p=0.001 n=6
Types 264,937 264,936 -1 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 2,479,239k (± 0.02%) 2,478,244k (± 0.01%) -996k (- 0.04%) 2,477,876k 2,478,497k p=0.031 n=6
Parse Time 5.29s (± 0.80%) 5.30s (± 0.97%) ~ 5.23s 5.36s p=0.748 n=6
Bind Time 1.72s (± 0.48%) 1.72s (± 0.57%) ~ 1.71s 1.73s p=0.862 n=6
Check Time 35.22s (± 0.35%) 35.34s (± 0.72%) ~ 35.06s 35.78s p=0.423 n=6
Emit Time 3.03s (± 5.73%) 3.00s (± 0.69%) ~ 2.98s 3.03s p=0.520 n=6
Total Time 45.28s (± 0.40%) 45.38s (± 0.63%) ~ 45.12s 45.85s p=0.689 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 260,917 260,916 -1 (- 0.00%) ~ ~ p=0.001 n=6
Types 106,357 106,356 -1 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 436,535k (± 0.04%) 436,686k (± 0.04%) ~ 436,450k 436,905k p=0.173 n=6
Parse Time 3.45s (± 0.89%) 3.46s (± 1.17%) ~ 3.40s 3.51s p=0.936 n=6
Bind Time 1.31s (± 0.39%) 1.31s (± 0.57%) ~ 1.30s 1.32s p=0.784 n=6
Check Time 18.15s (± 0.34%) 18.14s (± 0.29%) ~ 18.08s 18.21s p=0.810 n=6
Emit Time 1.53s (± 2.08%) 1.52s (± 1.64%) ~ 1.49s 1.56s p=0.872 n=6
Total Time 24.44s (± 0.26%) 24.43s (± 0.26%) ~ 24.32s 24.50s p=1.000 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 68 68 ~ ~ ~ p=1.000 n=6
Symbols 225,916 225,916 ~ ~ ~ p=1.000 n=6
Types 94,414 94,414 ~ ~ ~ p=1.000 n=6
Memory used 370,896k (± 0.03%) 370,975k (± 0.03%) ~ 370,800k 371,119k p=0.298 n=6
Parse Time 2.76s (± 0.42%) 2.74s (± 1.15%) ~ 2.70s 2.78s p=0.369 n=6
Bind Time 1.57s (± 1.90%) 1.57s (± 0.87%) ~ 1.56s 1.59s p=0.935 n=6
Check Time 15.83s (± 0.34%) 15.84s (± 0.30%) ~ 15.79s 15.90s p=0.747 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.16s (± 0.39%) 20.15s (± 0.36%) ~ 20.06s 20.24s p=1.000 n=6
vscode - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 3,099,008 3,098,997 -11 (- 0.00%) ~ ~ p=0.001 n=6
Types 1,068,764 1,068,755 -9 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 3,196,196k (± 0.01%) 3,196,336k (± 0.00%) ~ 3,196,260k 3,196,367k p=0.810 n=6
Parse Time 13.88s (± 0.40%) 13.88s (± 0.49%) ~ 13.80s 13.97s p=0.873 n=6
Bind Time 4.33s (± 0.25%) 4.33s (± 0.62%) ~ 4.30s 4.37s p=1.000 n=6
Check Time 81.57s (± 0.39%) 81.71s (± 0.30%) ~ 81.38s 81.98s p=0.297 n=6
Emit Time 22.40s (± 1.72%) 22.26s (± 0.29%) ~ 22.18s 22.37s p=0.575 n=6
Total Time 122.17s (± 0.37%) 122.18s (± 0.20%) ~ 121.87s 122.47s p=1.000 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 278,920 278,921 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 113,837 113,837 ~ ~ ~ p=1.000 n=6
Memory used 428,440k (± 0.02%) 428,437k (± 0.02%) ~ 428,319k 428,509k p=1.000 n=6
Parse Time 4.89s (± 0.44%) 4.89s (± 0.46%) ~ 4.86s 4.92s p=0.935 n=6
Bind Time 2.12s (± 0.75%) 2.13s (± 0.77%) ~ 2.11s 2.15s p=0.616 n=6
Check Time 21.87s (± 0.42%) 21.96s (± 0.63%) ~ 21.71s 22.11s p=0.199 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 28.88s (± 0.34%) 28.98s (± 0.57%) ~ 28.68s 29.15s p=0.229 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 540,027 540,075 +48 (+ 0.01%) ~ ~ p=0.001 n=6
Types 181,292 181,342 +50 (+ 0.03%) ~ ~ p=0.001 n=6
Memory used 483,516k (± 0.01%) 483,534k (± 0.01%) ~ 483,463k 483,624k p=0.810 n=6
Parse Time 4.01s (± 0.26%) 4.02s (± 0.47%) ~ 3.99s 4.04s p=1.000 n=6
Bind Time 1.42s (± 0.57%) 1.43s (± 0.85%) ~ 1.41s 1.44s p=0.677 n=6
Check Time 22.86s (± 0.22%) 22.84s (± 0.28%) ~ 22.76s 22.94s p=0.629 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 28.29s (± 0.21%) 28.28s (± 0.19%) ~ 28.22s 28.34s p=0.746 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 avatar Sep 24 '24 17:09 typescript-bot

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

Everything looks good!

typescript-bot avatar Sep 24 '24 18:09 typescript-bot

@typescript-bot pack this

jakebailey avatar Sep 25 '24 20:09 jakebailey

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

Command Status Results
pack this ✅ Started ✅ Results

typescript-bot avatar Sep 25 '24 20:09 typescript-bot

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/163721/artifacts?artifactName=tgz&fileId=38CAD1B2C67CA2FCC8B4A76C2D66BE653CFF98531EB9AA4C10F06CC22114767B02&fileName=/typescript-5.7.0-insiders.20240925.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/[email protected]".;

typescript-bot avatar Sep 25 '24 20:09 typescript-bot

I feel like this may have had some overlap with #60964; would be interested in a rebase of this PR.

jakebailey avatar Feb 21 '25 23:02 jakebailey

@jakebailey synced with main

Andarist avatar Feb 22 '25 08:02 Andarist