Skip to content
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

Revise discriminateTypeByDiscriminableItems function #53709

Merged
merged 5 commits into from
Apr 12, 2023
Merged

Conversation

ahejlsberg
Copy link
Member

@ahejlsberg ahejlsberg commented Apr 9, 2023

Implements what I suggest here.

Fixes #53165.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Apr 9, 2023
@ahejlsberg
Copy link
Member Author

@MariaSolOs Feel free to grab the changes in this PR and move them to yours. Alternatively, we can add the tests to this PR.

@ahejlsberg
Copy link
Member Author

ahejlsberg commented Apr 9, 2023

@MariaSolOs Note that the new approach made it possible to eliminate overloads and several parameters from discriminateTypeByDiscriminableItems.

@ahejlsberg ahejlsberg changed the title Fix53654 Revise discriminateTypeByDiscriminableItems function Apr 9, 2023
@MariaSolOs
Copy link
Contributor

@MariaSolOs Feel free to grab the changes in this PR and move them to yours. Alternatively, we can add the tests to this PR.

I think it's easier to just move the tests over. I can do that.

@ahejlsberg
Copy link
Member Author

@typescript-bot test this
@typescript-bot test top100
@typescript-bot user test this
@typescript-bot user test tsserver
@typescript-bot test tsserver top100
@typescript-bot run dt
@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 10, 2023

Heya @ahejlsberg, I've started to run the extended test suite on this PR at 65de9c2. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 10, 2023

Heya @ahejlsberg, I've started to run the diff-based top-repos suite (tsserver) on this PR at 65de9c2. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 10, 2023

Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at 65de9c2. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 10, 2023

Heya @ahejlsberg, I've started to run the diff-based user code test suite (tsserver) on this PR at 65de9c2. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 10, 2023

Heya @ahejlsberg, I've started to run the perf test suite on this PR at 65de9c2. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 10, 2023

Heya @ahejlsberg, I've started to run the diff-based top-repos suite on this PR at 65de9c2. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 10, 2023

Heya @ahejlsberg, I've started to run the diff-based user code test suite on this PR at 65de9c2. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@ahejlsberg Here are the results of running the user test suite comparing main and refs/pull/53709/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Package install failed"

Otherwise...

Everything looks good!

@typescript-bot
Copy link
Collaborator

@ahejlsberg Here are the results of running the user test suite comparing main and refs/pull/53709/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Heya @ahejlsberg, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here.

@typescript-bot
Copy link
Collaborator

@ahejlsberg
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..53709
Metric main 53709 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 365,382k (± 0.01%) 365,403k (± 0.01%) ~ 365,377k 365,463k p=0.297 n=6
Parse Time 3.40s (± 0.63%) 3.38s (± 0.56%) ~ 3.36s 3.41s p=0.142 n=6
Bind Time 1.12s (± 0.46%) 1.12s (± 0.67%) ~ 1.11s 1.13s p=0.784 n=6
Check Time 8.72s (± 0.35%) 8.74s (± 0.38%) ~ 8.69s 8.78s p=0.572 n=6
Emit Time 7.49s (± 0.57%) 7.46s (± 0.56%) ~ 7.42s 7.53s p=0.227 n=6
Total Time 20.74s (± 0.30%) 20.70s (± 0.16%) ~ 20.66s 20.74s p=0.196 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 190,798k (± 0.00%) 190,795k (± 0.01%) ~ 190,781k 190,813k p=0.748 n=6
Parse Time 1.49s (± 1.23%) 1.51s (± 1.44%) ~ 1.47s 1.53s p=0.223 n=6
Bind Time 0.77s (± 0.98%) 0.77s (± 1.51%) ~ 0.76s 0.79s p=0.734 n=6
Check Time 9.59s (± 0.50%) 9.64s (± 0.85%) ~ 9.54s 9.74s p=0.470 n=6
Emit Time 2.73s (± 0.95%) 2.74s (± 0.74%) ~ 2.71s 2.77s p=0.375 n=6
Total Time 14.58s (± 0.31%) 14.66s (± 0.68%) ~ 14.54s 14.79s p=0.295 n=6
Monaco - node (v18.10.0, x64)
Memory used 346,463k (± 0.00%) 346,496k (± 0.01%) ~ 346,450k 346,546k p=0.066 n=6
Parse Time 2.58s (± 1.06%) 2.60s (± 0.93%) ~ 2.57s 2.63s p=0.104 n=6
Bind Time 1.00s (± 0.75%) 1.00s (± 0.81%) ~ 1.00s 1.02s p=1.000 n=6
Check Time 7.13s (± 0.37%) 7.13s (± 0.38%) ~ 7.11s 7.18s p=0.807 n=6
Emit Time 4.27s (± 0.86%) 4.27s (± 0.86%) ~ 4.26s 4.35s p=0.392 n=6
Total Time 14.98s (± 0.37%) 15.01s (± 0.32%) ~ 14.94s 15.09s p=0.514 n=6
TFS - node (v18.10.0, x64)
Memory used 300,702k (± 0.01%) 300,710k (± 0.01%) ~ 300,687k 300,731k p=0.630 n=6
Parse Time 2.04s (± 1.12%) 2.06s (± 0.91%) ~ 2.04s 2.09s p=0.089 n=6
Bind Time 1.14s (± 0.45%) 1.14s (± 0.92%) ~ 1.13s 1.16s p=0.142 n=6
Check Time 6.52s (± 0.59%) 6.58s (± 0.40%) +0.06s (+ 0.84%) 6.54s 6.61s p=0.036 n=6
Emit Time 3.86s (± 0.61%) 3.85s (± 0.65%) ~ 3.82s 3.89s p=0.934 n=6
Total Time 13.55s (± 0.38%) 13.64s (± 0.27%) +0.09s (+ 0.65%) 13.58s 13.69s p=0.030 n=6
material-ui - node (v18.10.0, x64)
Memory used 480,154k (± 0.01%) 480,196k (± 0.01%) ~ 480,144k 480,233k p=0.093 n=6
Parse Time 3.04s (± 0.82%) 3.06s (± 0.39%) ~ 3.05s 3.08s p=0.064 n=6
Bind Time 0.92s (± 1.89%) 0.92s (± 1.15%) ~ 0.90s 0.93s p=0.558 n=6
Check Time 17.21s (± 0.52%) 17.14s (± 0.62%) ~ 17.03s 17.31s p=0.335 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.17s (± 0.50%) 21.12s (± 0.48%) ~ 21.01s 21.28s p=0.423 n=6
xstate - node (v18.10.0, x64)
Memory used 562,195k (± 0.04%) 562,174k (± 0.02%) ~ 562,051k 562,402k p=1.000 n=6
Parse Time 3.81s (± 0.27%) 3.84s (± 0.45%) +0.04s (+ 0.92%) 3.82s 3.86s p=0.008 n=6
Bind Time 1.65s (± 0.64%) 1.65s (± 0.38%) ~ 1.64s 1.66s p=0.303 n=6
Check Time 2.82s (± 0.69%) 2.84s (± 0.65%) ~ 2.81s 2.86s p=0.139 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 8.36s (± 0.19%) 8.42s (± 0.25%) +0.06s (+ 0.68%) 8.40s 8.45s p=0.005 n=6
Angular - node (v16.17.1, x64)
Memory used 364,760k (± 0.01%) 364,788k (± 0.00%) ~ 364,770k 364,812k p=0.093 n=6
Parse Time 3.54s (± 1.10%) 3.56s (± 0.92%) ~ 3.51s 3.60s p=0.517 n=6
Bind Time 1.18s (± 1.07%) 1.18s (± 0.83%) ~ 1.17s 1.19s p=0.799 n=6
Check Time 9.52s (± 0.47%) 9.57s (± 0.52%) ~ 9.50s 9.64s p=0.148 n=6
Emit Time 7.92s (± 0.68%) 7.95s (± 0.51%) ~ 7.92s 8.03s p=0.227 n=6
Total Time 22.17s (± 0.32%) 22.26s (± 0.40%) ~ 22.13s 22.37s p=0.128 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 192,491k (± 0.03%) 193,119k (± 0.74%) ~ 192,466k 196,023k p=0.128 n=6
Parse Time 1.57s (± 1.04%) 1.60s (± 0.56%) +0.02s (+ 1.59%) 1.59s 1.61s p=0.011 n=6
Bind Time 0.82s (± 0.63%) 0.83s (± 0.66%) ~ 0.82s 0.83s p=0.640 n=6
Check Time 10.27s (± 0.55%) 10.35s (± 0.66%) ~ 10.27s 10.43s p=0.077 n=6
Emit Time 2.99s (± 1.13%) 3.00s (± 0.65%) ~ 2.97s 3.03s p=0.332 n=6
Total Time 15.66s (± 0.39%) 15.78s (± 0.52%) +0.13s (+ 0.80%) 15.68s 15.90s p=0.031 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,738k (± 0.00%) 345,738k (± 0.00%) ~ 345,713k 345,754k p=0.936 n=6
Parse Time 2.72s (± 0.57%) 2.74s (± 0.33%) +0.02s (+ 0.74%) 2.73s 2.75s p=0.039 n=6
Bind Time 1.09s (± 0.69%) 1.08s (± 0.50%) ~ 1.08s 1.09s p=0.137 n=6
Check Time 7.79s (± 0.43%) 7.83s (± 0.53%) ~ 7.76s 7.88s p=0.192 n=6
Emit Time 4.47s (± 0.72%) 4.48s (± 0.70%) ~ 4.43s 4.52s p=0.513 n=6
Total Time 16.07s (± 0.37%) 16.13s (± 0.29%) ~ 16.07s 16.18s p=0.125 n=6
TFS - node (v16.17.1, x64)
Memory used 300,046k (± 0.01%) 300,040k (± 0.01%) ~ 299,996k 300,091k p=0.810 n=6
Parse Time 2.17s (± 0.70%) 2.18s (± 0.37%) ~ 2.17s 2.19s p=0.133 n=6
Bind Time 1.24s (± 0.66%) 1.23s (± 1.19%) ~ 1.21s 1.25s p=0.677 n=6
Check Time 7.21s (± 0.60%) 7.21s (± 0.72%) ~ 7.15s 7.29s p=0.809 n=6
Emit Time 4.35s (± 0.83%) 4.37s (± 0.80%) ~ 4.31s 4.41s p=0.126 n=6
Total Time 14.96s (± 0.44%) 14.99s (± 0.34%) ~ 14.93s 15.07s p=0.335 n=6
material-ui - node (v16.17.1, x64)
Memory used 479,423k (± 0.01%) 479,474k (± 0.01%) +51k (+ 0.01%) 479,440k 479,525k p=0.020 n=6
Parse Time 3.25s (± 0.36%) 3.26s (± 0.67%) ~ 3.23s 3.28s p=1.000 n=6
Bind Time 0.95s (± 0.54%) 0.96s (± 0.85%) ~ 0.95s 0.97s p=0.523 n=6
Check Time 18.23s (± 0.43%) 18.11s (± 1.00%) ~ 17.83s 18.32s p=0.199 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.44s (± 0.38%) 22.32s (± 0.92%) ~ 22.01s 22.56s p=0.468 n=6
xstate - node (v16.17.1, x64)
Memory used 559,662k (± 0.02%) 559,712k (± 0.03%) ~ 559,578k 559,984k p=0.471 n=6
Parse Time 3.98s (± 0.46%) 3.99s (± 0.43%) ~ 3.96s 4.01s p=0.629 n=6
Bind Time 1.75s (± 0.79%) 1.74s (± 0.69%) ~ 1.73s 1.76s p=1.000 n=6
Check Time 3.07s (± 0.57%) 3.05s (± 0.41%) ~ 3.04s 3.07s p=0.118 n=6
Emit Time 0.09s (± 5.53%) 0.10s (± 5.76%) ~ 0.09s 0.10s p=0.640 n=6
Total Time 8.89s (± 0.42%) 8.88s (± 0.44%) ~ 8.82s 8.93s p=0.936 n=6
Angular - node (v14.15.1, x64)
Memory used 358,557k (± 0.01%) 358,546k (± 0.00%) ~ 358,537k 358,556k p=0.298 n=6
Parse Time 3.63s (± 0.67%) 3.66s (± 0.90%) ~ 3.63s 3.71s p=0.121 n=6
Bind Time 1.21s (± 0.69%) 1.22s (± 0.85%) ~ 1.21s 1.23s p=0.923 n=6
Check Time 9.88s (± 0.44%) 9.96s (± 0.18%) +0.08s (+ 0.83%) 9.93s 9.98s p=0.024 n=6
Emit Time 8.24s (± 0.47%) 8.35s (± 0.68%) +0.11s (+ 1.29%) 8.24s 8.40s p=0.024 n=6
Total Time 22.96s (± 0.29%) 23.18s (± 0.24%) +0.22s (+ 0.97%) 23.12s 23.28s p=0.005 n=6
Compiler-Unions - node (v14.15.1, x64)
Memory used 187,790k (± 0.05%) 187,765k (± 0.06%) ~ 187,546k 187,826k p=0.298 n=6
Parse Time 1.59s (± 0.47%) 1.60s (± 0.64%) ~ 1.59s 1.62s p=0.063 n=6
Bind Time 0.84s (± 0.61%) 0.86s (± 1.27%) +0.02s (+ 1.98%) 0.85s 0.88s p=0.010 n=6
Check Time 10.33s (± 0.30%) 10.40s (± 0.66%) ~ 10.29s 10.47s p=0.061 n=6
Emit Time 3.20s (± 3.84%) 3.19s (± 3.59%) ~ 3.12s 3.42s p=0.809 n=6
Total Time 15.97s (± 0.86%) 16.05s (± 1.09%) ~ 15.87s 16.37s p=0.422 n=6
Monaco - node (v14.15.1, x64)
Memory used 340,660k (± 0.00%) 340,660k (± 0.00%) ~ 340,646k 340,679k p=0.936 n=6
Parse Time 2.83s (± 0.48%) 2.82s (± 0.47%) ~ 2.80s 2.83s p=0.437 n=6
Bind Time 1.10s (± 0.50%) 1.11s (± 0.50%) ~ 1.10s 1.11s p=1.000 n=6
Check Time 8.11s (± 0.38%) 8.15s (± 0.67%) ~ 8.04s 8.19s p=0.092 n=6
Emit Time 4.70s (± 0.77%) 4.72s (± 0.81%) ~ 4.68s 4.78s p=0.293 n=6
Total Time 16.73s (± 0.35%) 16.80s (± 0.49%) ~ 16.66s 16.91s p=0.172 n=6
TFS - node (v14.15.1, x64)
Memory used 295,137k (± 0.00%) 295,134k (± 0.01%) ~ 295,115k 295,152k p=0.936 n=6
Parse Time 2.40s (± 0.67%) 2.41s (± 0.50%) ~ 2.39s 2.42s p=0.410 n=6
Bind Time 1.07s (± 0.48%) 1.07s (± 0.70%) ~ 1.06s 1.08s p=0.784 n=6
Check Time 7.54s (± 0.55%) 7.60s (± 0.38%) +0.07s (+ 0.86%) 7.56s 7.62s p=0.027 n=6
Emit Time 4.30s (± 1.15%) 4.33s (± 1.15%) ~ 4.25s 4.38s p=0.196 n=6
Total Time 15.30s (± 0.44%) 15.41s (± 0.32%) +0.11s (+ 0.71%) 15.35s 15.47s p=0.020 n=6
material-ui - node (v14.15.1, x64)
Memory used 474,911k (± 0.00%) 474,896k (± 0.00%) ~ 474,877k 474,934k p=0.229 n=6
Parse Time 3.37s (± 0.35%) 3.39s (± 0.32%) +0.02s (+ 0.64%) 3.38s 3.41s p=0.011 n=6
Bind Time 0.99s (± 0.55%) 1.00s (± 0.41%) ~ 0.99s 1.00s p=0.282 n=6
Check Time 19.27s (± 0.83%) 19.01s (± 0.44%) -0.27s (- 1.37%) 18.90s 19.12s p=0.008 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.63s (± 0.67%) 23.40s (± 0.31%) -0.24s (- 1.00%) 23.31s 23.49s p=0.010 n=6
xstate - node (v14.15.1, x64)
Memory used 548,287k (± 0.00%) 548,276k (± 0.00%) ~ 548,251k 548,293k p=0.810 n=6
Parse Time 4.38s (± 0.70%) 4.27s (± 0.27%) -0.11s (- 2.55%) 4.26s 4.29s p=0.005 n=6
Bind Time 1.52s (± 0.54%) 1.67s (± 0.33%) +0.15s (+ 9.96%) 1.67s 1.68s p=0.003 n=6
Check Time 3.18s (± 0.58%) 3.18s (± 0.42%) ~ 3.17s 3.20s p=0.933 n=6
Emit Time 0.10s (± 4.15%) 0.09s (± 0.00%) 🟩-0.01s (- 8.47%) 0.09s 0.09s p=0.007 n=6
Total Time 9.19s (± 0.44%) 9.22s (± 0.18%) ~ 9.21s 9.25s p=0.197 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 53709 6
Baseline main 6

TSServer

Comparison Report - main..53709
Metric main 53709 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,409ms (± 0.62%) 2,405ms (± 0.39%) ~ 2,396ms 2,421ms p=0.873 n=6
Req 2 - geterr 5,690ms (± 1.60%) 5,710ms (± 0.31%) ~ 5,690ms 5,743ms p=0.936 n=6
Req 3 - references 335ms (± 0.55%) 337ms (± 0.99%) ~ 334ms 343ms p=0.328 n=6
Req 4 - navto 278ms (± 0.48%) 279ms (± 0.30%) ~ 278ms 280ms p=0.619 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 84ms (± 3.78%) 86ms (± 2.49%) ~ 84ms 90ms p=0.677 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,503ms (± 0.88%) 2,511ms (± 0.39%) ~ 2,497ms 2,522ms p=0.378 n=6
Req 2 - geterr 4,301ms (± 0.56%) 4,266ms (± 1.98%) ~ 4,118ms 4,339ms p=0.936 n=6
Req 3 - references 345ms (± 0.41%) 354ms (± 5.19%) ~ 345ms 391ms p=0.118 n=6
Req 4 - navto 291ms (± 0.84%) 294ms (± 2.37%) ~ 290ms 308ms p=0.618 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 67ms (± 5.44%) 65ms (± 5.99%) ~ 62ms 70ms p=0.562 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,015ms (± 0.34%) 3,025ms (± 0.59%) ~ 2,999ms 3,045ms p=0.229 n=6
Req 2 - geterr 1,607ms (± 1.08%) 1,610ms (± 0.86%) ~ 1,597ms 1,637ms p=0.296 n=6
Req 3 - references 106ms (± 1.25%) 107ms (± 1.37%) ~ 105ms 109ms p=0.162 n=6
Req 4 - navto 361ms (± 0.32%) 363ms (± 0.77%) ~ 360ms 367ms p=0.933 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 372ms (± 1.41%) 369ms (± 2.22%) ~ 360ms 379ms p=0.572 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,504ms (± 0.65%) 2,521ms (± 0.54%) +18ms (+ 0.70%) 2,501ms 2,539ms p=0.045 n=6
Req 2 - geterr 6,134ms (± 0.59%) 6,146ms (± 0.67%) ~ 6,067ms 6,176ms p=0.630 n=6
Req 3 - references 343ms (± 0.41%) 347ms (± 0.66%) +4ms (+ 1.17%) 343ms 349ms p=0.019 n=6
Req 4 - navto 282ms (± 0.58%) 281ms (± 0.62%) ~ 278ms 282ms p=0.684 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 81ms (± 1.50%) 82ms (± 5.77%) ~ 79ms 91ms p=0.620 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,680ms (± 1.18%) 2,669ms (± 0.45%) ~ 2,656ms 2,684ms p=0.575 n=6
Req 2 - geterr 4,659ms (± 0.62%) 4,659ms (± 0.73%) ~ 4,626ms 4,723ms p=1.000 n=6
Req 3 - references 358ms (± 0.47%) 359ms (± 0.74%) ~ 356ms 363ms p=0.743 n=6
Req 4 - navto 286ms (± 0.76%) 288ms (± 0.75%) ~ 284ms 289ms p=0.157 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 68ms (± 1.11%) 68ms (± 1.11%) ~ 67ms 69ms p=1.000 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,182ms (± 0.48%) 3,176ms (± 0.49%) ~ 3,159ms 3,201ms p=0.423 n=6
Req 2 - geterr 1,756ms (± 0.71%) 1,774ms (± 1.28%) ~ 1,752ms 1,815ms p=0.109 n=6
Req 3 - references 116ms (± 2.93%) 114ms (± 0.66%) ~ 113ms 115ms p=0.250 n=6
Req 4 - navto 346ms (± 1.61%) 351ms (± 0.43%) +5ms (+ 1.45%) 348ms 352ms p=0.035 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 387ms (± 0.82%) 387ms (± 0.79%) ~ 384ms 392ms p=1.000 n=6
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,608ms (± 0.67%) 2,625ms (± 0.33%) ~ 2,609ms 2,633ms p=0.108 n=6
Req 2 - geterr 6,409ms (± 1.21%) 6,428ms (± 1.04%) ~ 6,334ms 6,509ms p=0.810 n=6
Req 3 - references 362ms (± 0.89%) 362ms (± 0.64%) ~ 361ms 367ms p=0.505 n=6
Req 4 - navto 285ms (± 0.66%) 285ms (± 1.15%) ~ 281ms 288ms p=0.687 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 93ms (± 6.69%) 92ms (± 8.03%) ~ 84ms 103ms p=0.858 n=6
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,819ms (± 0.87%) 2,828ms (± 0.52%) ~ 2,801ms 2,841ms p=0.230 n=6
Req 2 - geterr 4,702ms (± 0.46%) 4,708ms (± 0.24%) ~ 4,695ms 4,720ms p=0.689 n=6
Req 3 - references 378ms (± 1.21%) 381ms (± 0.39%) ~ 379ms 383ms p=0.192 n=6
Req 4 - navto 293ms (± 0.28%) 292ms (± 0.64%) ~ 289ms 294ms p=0.354 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 81ms (± 0.50%) 81ms (± 0.00%) ~ 81ms 81ms p=0.405 n=6
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 3,403ms (± 0.59%) 3,407ms (± 0.67%) ~ 3,385ms 3,438ms p=0.936 n=6
Req 2 - geterr 1,876ms (± 0.68%) 1,865ms (± 1.56%) ~ 1,821ms 1,895ms p=0.689 n=6
Req 3 - references 125ms (± 0.44%) 127ms (± 1.56%) +2ms (+ 1.61%) 125ms 129ms p=0.025 n=6
Req 4 - navto 380ms (± 0.31%) 379ms (± 0.98%) ~ 373ms 383ms p=0.935 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 410ms (± 0.78%) 413ms (± 0.81%) ~ 409ms 418ms p=0.168 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
Benchmark Name Iterations
Current 53709 6
Baseline main 6

Startup

Comparison Report - main..53709
Metric main 53709 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 141.42ms (± 0.19%) 141.91ms (± 0.18%) +0.48ms (+ 0.34%) 141.21ms 145.34ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 219.55ms (± 0.16%) 221.00ms (± 0.19%) +1.45ms (+ 0.66%) 219.86ms 225.95ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 221.14ms (± 0.17%) 221.98ms (± 0.18%) +0.84ms (+ 0.38%) 221.02ms 228.94ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 202.97ms (± 0.16%) 203.87ms (± 0.18%) +0.90ms (+ 0.44%) 202.92ms 208.09ms p=0.000 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
Benchmark Name Iterations
Current 53709 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

@ahejlsberg Here are the results of running the top-repos suite comparing main and refs/pull/53709/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Hey @ahejlsberg, the results of running the DT tests are ready.
There were interesting changes:

Branch only errors:

Package: pdfmake
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/pdfmake/test/pdfmake-interfaces-tests.ts:22:1
ERROR: 22:1  expect  TypeScript@local compile error: 
Unused '@ts-expect-error' directive.
ERROR: 25:5  expect  TypeScript@local compile error: 
Type 'never[]' is not assignable to type 'undefined'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: gensync
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/gensync/gensync-tests.ts:153:5
ERROR: 153:5  expect  TypeScript@local compile error: 
Unused '@ts-expect-error' directive.
ERROR: 155:5  expect  TypeScript@local compile error: 
Type '(path: string, encoding: "utf8" | "ascii", cb: (err: Error, result: string) => void) => void' is not assignable to type 'undefined'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

You can check the log here.

@MariaSolOs
Copy link
Contributor

@ahejlsberg I think that the description should link #53165, not the previous PR.

@typescript-bot
Copy link
Collaborator

@ahejlsberg Here are the results of running the top-repos suite comparing main and refs/pull/53709/merge:

Everything looks good!

Copy link
Member

@DanielRosenwasser DanielRosenwasser left a comment

Choose a reason for hiding this comment

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

Looks great!

One direction I was thinking about this before was to have include be a list of Ternarys while tracking whether true matches and a non-match occurred.

With your scheme, you could start out with Ternary.True and move to Ternary.Maybe. If a match occurs, you set all of those Maybes to Ternary.False. This would never allocate an exclude array, but you could still keep track of whether any Maybes were ever set to avoid walking the list of types.

I still think the change is good as-is, though I might take a swing at that in another pass.

// If the remaining target types include at least one with a matching discriminant, eliminate those that
// have non-matching discriminants. This ensures that we ignore erroneous discriminators and gradually
// refine the target set without eliminating every constituent (which would lead to `never`).
let exclude: number[] | undefined;
Copy link
Member

Choose a reason for hiding this comment

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

I might call this excludeIndexes

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Apr 10, 2023

Hm, check time does seem to go higher on a few repos. Let's try this again.

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 10, 2023

Heya @DanielRosenwasser, I've started to run the perf test suite on this PR at 65de9c2. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..53709
Metric main 53709 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 365,388k (± 0.01%) 365,376k (± 0.01%) ~ 365,330k 365,405k p=0.748 n=6
Parse Time 3.38s (± 0.81%) 3.37s (± 0.85%) ~ 3.34s 3.41s p=0.744 n=6
Bind Time 1.11s (± 1.10%) 1.11s (± 0.93%) ~ 1.10s 1.12s p=0.752 n=6
Check Time 8.76s (± 0.59%) 8.75s (± 0.54%) ~ 8.68s 8.81s p=0.687 n=6
Emit Time 7.50s (± 0.70%) 7.49s (± 0.94%) ~ 7.38s 7.58s p=1.000 n=6
Total Time 20.75s (± 0.42%) 20.72s (± 0.40%) ~ 20.61s 20.84s p=0.521 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 191,733k (± 1.20%) 191,769k (± 1.22%) ~ 190,787k 196,544k p=0.378 n=6
Parse Time 1.50s (± 0.81%) 1.50s (± 0.54%) ~ 1.49s 1.51s p=1.000 n=6
Bind Time 0.76s (± 0.68%) 0.77s (± 0.82%) ~ 0.76s 0.78s p=0.091 n=6
Check Time 9.59s (± 0.70%) 9.58s (± 0.78%) ~ 9.52s 9.69s p=0.521 n=6
Emit Time 2.73s (± 1.22%) 2.72s (± 0.45%) ~ 2.70s 2.73s p=0.684 n=6
Total Time 14.58s (± 0.47%) 14.56s (± 0.50%) ~ 14.50s 14.66s p=0.575 n=6
Monaco - node (v18.10.0, x64)
Memory used 346,464k (± 0.01%) 346,459k (± 0.01%) ~ 346,431k 346,497k p=0.689 n=6
Parse Time 2.59s (± 1.08%) 2.58s (± 1.40%) ~ 2.54s 2.64s p=0.419 n=6
Bind Time 1.00s (± 0.00%) 1.00s (± 0.41%) ~ 1.00s 1.01s p=0.405 n=6
Check Time 7.09s (± 0.36%) 7.13s (± 0.54%) ~ 7.09s 7.19s p=0.146 n=6
Emit Time 4.24s (± 0.66%) 4.24s (± 0.98%) ~ 4.18s 4.29s p=1.000 n=6
Total Time 14.92s (± 0.45%) 14.95s (± 0.67%) ~ 14.84s 15.08s p=0.748 n=6
TFS - node (v18.10.0, x64)
Memory used 300,724k (± 0.01%) 300,719k (± 0.01%) ~ 300,684k 300,744k p=0.378 n=6
Parse Time 2.05s (± 1.05%) 2.05s (± 1.45%) ~ 2.02s 2.09s p=0.809 n=6
Bind Time 1.14s (± 0.72%) 1.14s (± 0.78%) ~ 1.13s 1.15s p=0.550 n=6
Check Time 6.52s (± 0.37%) 6.56s (± 0.25%) +0.04s (+ 0.61%) 6.53s 6.58s p=0.015 n=6
Emit Time 3.84s (± 0.58%) 3.86s (± 0.71%) ~ 3.83s 3.89s p=0.182 n=6
Total Time 13.54s (± 0.30%) 13.61s (± 0.33%) ~ 13.55s 13.67s p=0.054 n=6
material-ui - node (v18.10.0, x64)
Memory used 480,119k (± 0.01%) 480,169k (± 0.01%) +50k (+ 0.01%) 480,141k 480,208k p=0.031 n=6
Parse Time 3.05s (± 1.12%) 3.04s (± 1.33%) ~ 3.00s 3.10s p=0.462 n=6
Bind Time 0.92s (± 1.15%) 0.92s (± 2.02%) ~ 0.91s 0.96s p=0.406 n=6
Check Time 17.18s (± 0.55%) 16.98s (± 0.22%) -0.20s (- 1.17%) 16.93s 17.04s p=0.005 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.14s (± 0.43%) 20.94s (± 0.25%) -0.20s (- 0.95%) 20.87s 21.02s p=0.005 n=6
xstate - node (v18.10.0, x64)
Memory used 562,070k (± 0.02%) 562,068k (± 0.01%) ~ 561,945k 562,158k p=0.810 n=6
Parse Time 3.80s (± 0.44%) 3.81s (± 0.66%) ~ 3.77s 3.84s p=0.681 n=6
Bind Time 1.64s (± 0.25%) 1.64s (± 0.32%) ~ 1.63s 1.64s p=1.000 n=6
Check Time 2.82s (± 0.65%) 2.82s (± 0.77%) ~ 2.79s 2.85s p=0.871 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 8.35s (± 0.34%) 8.35s (± 0.45%) ~ 8.28s 8.38s p=0.809 n=6
Angular - node (v16.17.1, x64)
Memory used 364,762k (± 0.01%) 364,788k (± 0.01%) ~ 364,744k 364,847k p=0.173 n=6
Parse Time 3.55s (± 0.79%) 3.55s (± 0.83%) ~ 3.52s 3.58s p=0.325 n=6
Bind Time 1.18s (± 1.12%) 1.18s (± 1.16%) ~ 1.17s 1.21s p=0.741 n=6
Check Time 9.55s (± 0.86%) 9.55s (± 0.47%) ~ 9.49s 9.61s p=0.748 n=6
Emit Time 7.95s (± 0.45%) 8.00s (± 0.49%) +0.05s (+ 0.63%) 7.94s 8.06s p=0.044 n=6
Total Time 22.25s (± 0.50%) 22.29s (± 0.39%) ~ 22.18s 22.41s p=0.470 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 193,624k (± 0.89%) 192,583k (± 0.03%) ~ 192,486k 192,662k p=0.810 n=6
Parse Time 1.59s (± 0.79%) 1.59s (± 0.47%) ~ 1.58s 1.60s p=1.000 n=6
Bind Time 0.82s (± 0.00%) 0.82s (± 0.63%) ~ 0.82s 0.83s p=0.174 n=6
Check Time 10.32s (± 0.55%) 10.27s (± 0.51%) ~ 10.18s 10.31s p=0.196 n=6
Emit Time 2.98s (± 0.69%) 2.99s (± 0.58%) ~ 2.96s 3.01s p=0.683 n=6
Total Time 15.71s (± 0.25%) 15.68s (± 0.37%) ~ 15.60s 15.73s p=0.573 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,745k (± 0.00%) 345,750k (± 0.00%) ~ 345,740k 345,763k p=0.936 n=6
Parse Time 2.71s (± 0.77%) 2.72s (± 0.39%) ~ 2.70s 2.73s p=0.285 n=6
Bind Time 1.08s (± 0.50%) 1.08s (± 0.50%) ~ 1.08s 1.09s p=1.000 n=6
Check Time 7.79s (± 0.41%) 7.80s (± 0.52%) ~ 7.75s 7.86s p=0.688 n=6
Emit Time 4.48s (± 0.77%) 4.47s (± 0.33%) ~ 4.45s 4.49s p=0.519 n=6
Total Time 16.07s (± 0.45%) 16.07s (± 0.20%) ~ 16.01s 16.10s p=0.687 n=6
TFS - node (v16.17.1, x64)
Memory used 300,058k (± 0.01%) 300,064k (± 0.01%) ~ 300,031k 300,104k p=0.873 n=6
Parse Time 2.16s (± 0.45%) 2.16s (± 0.68%) ~ 2.14s 2.18s p=0.615 n=6
Bind Time 1.23s (± 1.26%) 1.23s (± 1.03%) ~ 1.21s 1.24s p=1.000 n=6
Check Time 7.21s (± 0.37%) 7.20s (± 0.48%) ~ 7.17s 7.26s p=0.569 n=6
Emit Time 4.35s (± 0.86%) 4.31s (± 0.39%) -0.04s (- 1.03%) 4.29s 4.33s p=0.016 n=6
Total Time 14.95s (± 0.35%) 14.90s (± 0.31%) ~ 14.82s 14.96s p=0.169 n=6
material-ui - node (v16.17.1, x64)
Memory used 479,457k (± 0.01%) 479,471k (± 0.00%) ~ 479,456k 479,494k p=0.173 n=6
Parse Time 3.25s (± 0.34%) 3.24s (± 0.37%) ~ 3.23s 3.26s p=0.359 n=6
Bind Time 0.95s (± 0.43%) 0.95s (± 0.54%) ~ 0.95s 0.96s p=0.114 n=6
Check Time 18.29s (± 0.50%) 18.05s (± 0.80%) -0.24s (- 1.30%) 17.95s 18.30s p=0.024 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.49s (± 0.41%) 22.25s (± 0.63%) -0.24s (- 1.07%) 22.15s 22.50s p=0.024 n=6
xstate - node (v16.17.1, x64)
Memory used 559,800k (± 0.03%) 559,805k (± 0.02%) ~ 559,685k 559,966k p=1.000 n=6
Parse Time 3.98s (± 0.19%) 3.98s (± 0.29%) ~ 3.97s 4.00s p=0.318 n=6
Bind Time 1.73s (± 0.30%) 1.74s (± 0.47%) +0.01s (+ 0.58%) 1.73s 1.75s p=0.050 n=6
Check Time 3.06s (± 0.41%) 3.06s (± 0.48%) ~ 3.04s 3.08s p=1.000 n=6
Emit Time 0.09s (± 5.53%) 0.09s (± 4.45%) ~ 0.09s 0.10s p=0.595 n=6
Total Time 8.87s (± 0.21%) 8.87s (± 0.38%) ~ 8.83s 8.91s p=1.000 n=6
Angular - node (v14.15.1, x64)
Memory used 358,552k (± 0.00%) 358,559k (± 0.00%) ~ 358,550k 358,569k p=0.173 n=6
Parse Time 3.63s (± 0.64%) 3.63s (± 0.28%) ~ 3.61s 3.64s p=0.745 n=6
Bind Time 1.21s (± 0.34%) 1.21s (± 0.34%) ~ 1.21s 1.22s p=0.218 n=6
Check Time 9.93s (± 0.37%) 9.93s (± 0.50%) ~ 9.84s 9.97s p=0.872 n=6
Emit Time 8.34s (± 1.05%) 8.29s (± 0.42%) ~ 8.25s 8.35s p=0.336 n=6
Total Time 23.11s (± 0.52%) 23.07s (± 0.31%) ~ 22.95s 23.16s p=0.575 n=6
Compiler-Unions - node (v14.15.1, x64)
Memory used 187,829k (± 0.01%) 187,818k (± 0.01%) ~ 187,786k 187,839k p=0.378 n=6
Parse Time 1.59s (± 0.66%) 1.59s (± 0.32%) ~ 1.59s 1.60s p=0.794 n=6
Bind Time 0.84s (± 0.48%) 0.85s (± 0.74%) +0.01s (+ 0.99%) 0.84s 0.86s p=0.033 n=6
Check Time 10.32s (± 0.57%) 10.37s (± 0.32%) ~ 10.30s 10.39s p=0.170 n=6
Emit Time 3.14s (± 1.13%) 3.14s (± 1.18%) ~ 3.11s 3.21s p=0.746 n=6
Total Time 15.90s (± 0.41%) 15.95s (± 0.40%) ~ 15.85s 16.05s p=0.148 n=6
Monaco - node (v14.15.1, x64)
Memory used 340,650k (± 0.01%) 340,661k (± 0.01%) ~ 340,642k 340,691k p=0.298 n=6
Parse Time 2.81s (± 0.43%) 2.82s (± 0.53%) ~ 2.79s 2.83s p=0.739 n=6
Bind Time 1.10s (± 1.45%) 1.10s (± 0.68%) ~ 1.09s 1.11s p=1.000 n=6
Check Time 8.12s (± 0.34%) 8.15s (± 0.43%) ~ 8.11s 8.21s p=0.221 n=6
Emit Time 4.68s (± 0.65%) 4.73s (± 0.94%) ~ 4.70s 4.81s p=0.056 n=6
Total Time 16.72s (± 0.31%) 16.78s (± 0.44%) ~ 16.72s 16.90s p=0.199 n=6
TFS - node (v14.15.1, x64)
Memory used 295,144k (± 0.00%) 295,136k (± 0.00%) ~ 295,127k 295,143k p=0.574 n=6
Parse Time 2.39s (± 1.23%) 2.41s (± 1.08%) ~ 2.37s 2.45s p=0.329 n=6
Bind Time 1.07s (± 1.09%) 1.07s (± 0.76%) ~ 1.06s 1.08s p=1.000 n=6
Check Time 7.57s (± 0.20%) 7.56s (± 0.30%) ~ 7.54s 7.60s p=0.744 n=6
Emit Time 4.29s (± 0.85%) 4.29s (± 0.87%) ~ 4.24s 4.35s p=1.000 n=6
Total Time 15.31s (± 0.44%) 15.33s (± 0.37%) ~ 15.23s 15.37s p=0.809 n=6
material-ui - node (v14.15.1, x64)
Memory used 474,933k (± 0.01%) 474,899k (± 0.01%) ~ 474,867k 474,934k p=0.093 n=6
Parse Time 3.36s (± 0.15%) 3.37s (± 0.45%) ~ 3.35s 3.39s p=1.000 n=6
Bind Time 1.00s (± 0.52%) 0.99s (± 0.41%) ~ 0.99s 1.00s p=0.112 n=6
Check Time 19.33s (± 0.83%) 18.91s (± 0.69%) -0.42s (- 2.16%) 18.75s 19.08s p=0.006 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.69s (± 0.68%) 23.27s (± 0.52%) -0.42s (- 1.77%) 23.12s 23.43s p=0.005 n=6
xstate - node (v14.15.1, x64)
Memory used 548,270k (± 0.00%) 548,278k (± 0.00%) ~ 548,259k 548,295k p=0.296 n=6
Parse Time 4.31s (± 1.72%) 4.23s (± 0.28%) -0.07s (- 1.74%) 4.21s 4.24s p=0.049 n=6
Bind Time 1.59s (± 4.86%) 1.64s (± 2.29%) ~ 1.58s 1.67s p=0.120 n=6
Check Time 3.17s (± 0.53%) 3.17s (± 1.49%) ~ 3.12s 3.26s p=0.685 n=6
Emit Time 0.09s (± 5.53%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=0.174 n=6
Total Time 9.15s (± 0.19%) 9.13s (± 0.41%) ~ 9.06s 9.16s p=0.220 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 53709 6
Baseline main 6

TSServer

Comparison Report - main..53709
Metric main 53709 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,396ms (± 0.36%) 2,405ms (± 0.54%) ~ 2,386ms 2,420ms p=0.199 n=6
Req 2 - geterr 5,708ms (± 0.47%) 5,731ms (± 0.68%) ~ 5,699ms 5,803ms p=0.298 n=6
Req 3 - references 335ms (± 0.44%) 336ms (± 0.55%) ~ 334ms 339ms p=0.869 n=6
Req 4 - navto 282ms (± 0.98%) 281ms (± 1.37%) ~ 277ms 288ms p=0.460 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 84ms (± 0.90%) 86ms (± 3.06%) ~ 84ms 90ms p=0.054 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,530ms (± 0.65%) 2,516ms (± 0.71%) ~ 2,493ms 2,537ms p=0.376 n=6
Req 2 - geterr 4,251ms (± 2.06%) 4,235ms (± 2.07%) ~ 4,070ms 4,313ms p=0.575 n=6
Req 3 - references 343ms (± 0.35%) 345ms (± 0.51%) ~ 342ms 347ms p=0.216 n=6
Req 4 - navto 292ms (± 1.07%) 290ms (± 0.99%) ~ 285ms 293ms p=0.255 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 66ms (± 7.60%) 66ms (± 7.58%) ~ 62ms 74ms p=0.623 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,017ms (± 0.26%) 3,012ms (± 0.37%) ~ 2,994ms 3,025ms p=0.574 n=6
Req 2 - geterr 1,614ms (± 0.54%) 1,612ms (± 0.71%) ~ 1,596ms 1,626ms p=0.748 n=6
Req 3 - references 107ms (± 1.56%) 107ms (± 0.76%) ~ 106ms 108ms p=0.682 n=6
Req 4 - navto 362ms (± 0.76%) 362ms (± 0.59%) ~ 360ms 366ms p=0.319 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 375ms (± 1.54%) 369ms (± 1.94%) ~ 358ms 377ms p=0.298 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,504ms (± 0.44%) 2,505ms (± 0.58%) ~ 2,487ms 2,526ms p=1.000 n=6
Req 2 - geterr 6,129ms (± 0.44%) 6,110ms (± 0.86%) ~ 6,020ms 6,167ms p=0.689 n=6
Req 3 - references 344ms (± 0.47%) 345ms (± 0.56%) ~ 343ms 348ms p=0.465 n=6
Req 4 - navto 278ms (± 0.48%) 278ms (± 0.63%) ~ 276ms 281ms p=0.325 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 81ms (± 1.71%) 80ms (± 1.58%) ~ 78ms 81ms p=0.868 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,676ms (± 1.31%) 2,683ms (± 0.72%) ~ 2,659ms 2,713ms p=0.689 n=6
Req 2 - geterr 4,670ms (± 0.39%) 4,655ms (± 0.40%) ~ 4,632ms 4,676ms p=0.295 n=6
Req 3 - references 358ms (± 0.63%) 359ms (± 0.49%) ~ 356ms 361ms p=0.459 n=6
Req 4 - navto 284ms (± 0.75%) 287ms (± 0.42%) +3ms (+ 1.11%) 285ms 288ms p=0.030 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 67ms (± 0.77%) 68ms (± 1.21%) ~ 67ms 69ms p=0.523 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,169ms (± 0.44%) 3,167ms (± 0.37%) ~ 3,152ms 3,182ms p=0.748 n=6
Req 2 - geterr 1,756ms (± 1.03%) 1,774ms (± 1.13%) ~ 1,748ms 1,800ms p=0.149 n=6
Req 3 - references 116ms (± 4.16%) 115ms (± 2.49%) ~ 112ms 120ms p=0.805 n=6
Req 4 - navto 345ms (± 1.53%) 347ms (± 1.14%) ~ 339ms 350ms p=0.805 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 387ms (± 1.35%) 387ms (± 0.71%) ~ 383ms 390ms p=0.685 n=6
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,595ms (± 0.82%) 2,602ms (± 0.48%) ~ 2,594ms 2,626ms p=0.872 n=6
Req 2 - geterr 6,419ms (± 1.50%) 6,391ms (± 1.51%) ~ 6,263ms 6,489ms p=0.810 n=6
Req 3 - references 361ms (± 1.49%) 368ms (± 5.52%) ~ 357ms 409ms p=0.687 n=6
Req 4 - navto 286ms (± 0.85%) 283ms (± 1.16%) ~ 278ms 286ms p=0.195 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 92ms (± 5.46%) 91ms (± 5.30%) ~ 89ms 101ms p=0.654 n=6
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,809ms (± 0.52%) 2,827ms (± 0.45%) +18ms (+ 0.63%) 2,803ms 2,840ms p=0.020 n=6
Req 2 - geterr 4,711ms (± 0.55%) 4,672ms (± 1.42%) ~ 4,538ms 4,712ms p=0.378 n=6
Req 3 - references 379ms (± 0.76%) 381ms (± 0.49%) ~ 378ms 383ms p=0.226 n=6
Req 4 - navto 292ms (± 0.50%) 293ms (± 0.64%) ~ 290ms 295ms p=0.565 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 81ms (± 0.50%) 81ms (± 0.50%) ~ 81ms 82ms p=1.000 n=6
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 3,395ms (± 0.39%) 3,398ms (± 0.20%) ~ 3,389ms 3,407ms p=0.630 n=6
Req 2 - geterr 1,857ms (± 0.95%) 1,854ms (± 1.62%) ~ 1,799ms 1,886ms p=1.000 n=6
Req 3 - references 126ms (± 1.31%) 125ms (± 0.51%) ~ 124ms 126ms p=0.438 n=6
Req 4 - navto 380ms (± 0.54%) 378ms (± 0.85%) ~ 372ms 381ms p=0.570 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 409ms (± 0.66%) 410ms (± 1.16%) ~ 406ms 416ms p=0.935 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
Benchmark Name Iterations
Current 53709 6
Baseline main 6

Startup

Comparison Report - main..53709
Metric main 53709 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 141.50ms (± 0.19%) 141.43ms (± 0.17%) -0.07ms (- 0.05%) 140.88ms 144.55ms p=0.004 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 219.81ms (± 0.18%) 219.66ms (± 0.19%) -0.14ms (- 0.07%) 218.55ms 226.51ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 221.25ms (± 0.17%) 221.26ms (± 0.16%) ~ 220.40ms 226.05ms p=0.595 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 203.06ms (± 0.20%) 203.14ms (± 0.18%) +0.07ms (+ 0.04%) 202.24ms 209.80ms p=0.000 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
Benchmark Name Iterations
Current 53709 6
Baseline main 6

Developer Information:

Download Benchmark

@ahejlsberg
Copy link
Member Author

@DanielRosenwasser Once again, just run the perf tests until you get the desired outcome!

@typescript-bot typescript-bot added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Apr 11, 2023
@ahejlsberg
Copy link
Member Author

ahejlsberg commented Apr 11, 2023

Latest commit implements @DanielRosenwasser's suggestion of using Ternary.Maybe to mark exclusion candidates. This change has no effect on the overall algorithm.

@ahejlsberg
Copy link
Member Author

There are a few baseline changes in DT and RWC, all related to picking better matching candidates for error reporting. Otherwise, tests and performance are unchanged, so I think this one is ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intellisense suggests invalid property values within union objects
4 participants