Skip to content

Conversation

@weswigham
Copy link
Member

Fixes #53179

I'm still working on minimizing the repro, since it pulls in all of mongoose and mongodb, but I know this fixes the problem, and want to queue up a perf run to see if this change ends up being perf positive (I think it might be).

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Mar 30, 2023
@weswigham
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 30, 2023

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

Update: The results are in!

const newTypeParam = (constraint.type as IndexedAccessType).objectType;
const newMappedType = replaceIndexedAccess(target, constraint.type as ReplaceableIndexedAccessType, newTypeParam);
target = newMappedType as MappedType;
constraint = getIndexType(newTypeParam) as IndexType;
Copy link
Member Author

Choose a reason for hiding this comment

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

By moving this logic from reverse mapped type property construction forward into reverse mapped type construction, we can cut down on the number of reverse mapped type identities (and property symbols) we make - this is critical to actually being able to block the recursion, since it makes a generative recursion into a self recursion.

// Since `inferReverseMappedType` avoids pulling on structure in its inference result, we *shouldn't* have a recursive
// type resolution request, but if we somehow do, we should error.
if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) {
reportCircularityError(symbol);
Copy link
Member Author

Choose a reason for hiding this comment

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

In the current version of this PR, this error is never reported, since I've avoided pulling on the structure elsewhere, but this is what's needed to prevent another stack depth error from happening with any other incidental recursion in reverse mapped type resolution. Plus, basically every other branch of getTypeOfSymbol has a guard like this. Cue "how did we even manage to get by without circularity guards here?" response.

inferTypes([inference], sourceType, templateType);
return getTypeFromInference(inference) || unknownType;
// Skip subtype reducing the inference result (this can eagerly resolve structure, which we'd rather avoid while doing this inference)
return getTypeFromInference(inference, UnionReduction.Literal) || unknownType;
Copy link
Member Author

Choose a reason for hiding this comment

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

By only doing Literal reductions on this inference result, we save some time, and prevent pulling on the structure of a recursive reverse mapped type while it's still being constructed. What we lose is, conceivably, reducing a reverse mapped type property that resolves to {x} | {x,y} to {x,y} (Or, perhaps more relevant, Function | RecursiveReverseMappingThatResolvesToASpecificFunction becoming Function, which is closer to what mongoose has); but I'd argue that most reverse mapped types only involve a single type, maybe union'd with undefined anyway.

The alternative is just issuing an error on the recursion, and that code is in-place, but that error feels bad because it only appears on instantiation and usage of the reverse mapped type, and not when it's made, even though the error appears at its' declaration site.

(note: as an aside, the command-line compiler does not like this and won't display the error, since it's generated for a file that already had direct diagnostics cached, resulting in a very silent, sneaky any type popping out of inference without an error reported. I suspect any deferred structure resolution that has a circularity can trigger this poor error reporting behavior. I can dodge this by using currentNode as the error node for the circularity error instead of the symbol's declaration site, but then you loose where the circularity occurs, so it probably at least needs a related span... better would be fixing up the program to actually pick up diagnostics added in files which it already collected diagnostics in once.)

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..53595
Metric main 53595 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 362,328k (± 0.01%) 362,361k (± 0.01%) ~ 362,321k 362,411k p=0.093 n=6
Parse Time 3.36s (± 0.31%) 3.36s (± 0.70%) ~ 3.32s 3.38s p=0.868 n=6
Bind Time 1.11s (± 0.46%) 1.11s (± 0.37%) ~ 1.11s 1.12s p=0.595 n=6
Check Time 8.66s (± 0.31%) 8.66s (± 0.37%) ~ 8.63s 8.71s p=0.566 n=6
Emit Time 7.45s (± 0.52%) 7.43s (± 0.35%) ~ 7.40s 7.46s p=0.372 n=6
Total Time 20.58s (± 0.26%) 20.55s (± 0.18%) ~ 20.52s 20.61s p=0.295 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 191,728k (± 1.18%) 191,772k (± 1.23%) ~ 190,747k 196,598k p=0.936 n=6
Parse Time 1.49s (± 0.66%) 1.48s (± 1.73%) ~ 1.43s 1.50s p=0.563 n=6
Bind Time 0.77s (± 0.00%) 0.77s (± 0.72%) ~ 0.76s 0.77s p=0.071 n=6
Check Time 9.65s (± 0.65%) 9.60s (± 0.24%) ~ 9.57s 9.63s p=0.126 n=6
Emit Time 2.74s (± 0.88%) 2.74s (± 0.69%) ~ 2.72s 2.77s p=0.746 n=6
Total Time 14.65s (± 0.52%) 14.58s (± 0.25%) ~ 14.53s 14.63s p=0.109 n=6
Monaco - node (v18.10.0, x64)
Memory used 346,446k (± 0.01%) 346,458k (± 0.01%) ~ 346,434k 346,486k p=0.229 n=6
Parse Time 2.58s (± 1.43%) 2.58s (± 1.05%) ~ 2.53s 2.61s p=0.809 n=6
Bind Time 1.00s (± 0.63%) 0.99s (± 1.04%) ~ 0.98s 1.01s p=0.203 n=6
Check Time 7.11s (± 0.44%) 7.09s (± 0.34%) ~ 7.05s 7.11s p=0.372 n=6
Emit Time 4.25s (± 1.09%) 4.22s (± 0.41%) ~ 4.20s 4.25s p=0.188 n=6
Total Time 14.94s (± 0.65%) 14.89s (± 0.25%) ~ 14.84s 14.94s p=0.419 n=6
TFS - node (v18.10.0, x64)
Memory used 300,678k (± 0.01%) 300,677k (± 0.01%) ~ 300,650k 300,704k p=0.810 n=6
Parse Time 2.06s (± 1.47%) 2.02s (± 0.51%) -0.04s (- 1.78%) 2.01s 2.03s p=0.040 n=6
Bind Time 1.14s (± 0.36%) 1.13s (± 0.72%) ~ 1.12s 1.14s p=0.248 n=6
Check Time 6.55s (± 0.53%) 6.51s (± 0.37%) ~ 6.47s 6.54s p=0.053 n=6
Emit Time 3.86s (± 0.90%) 3.83s (± 0.69%) -0.03s (- 0.91%) 3.78s 3.86s p=0.048 n=6
Total Time 13.62s (± 0.51%) 13.50s (± 0.33%) -0.12s (- 0.88%) 13.41s 13.54s p=0.013 n=6
material-ui - node (v18.10.0, x64)
Memory used 477,183k (± 0.02%) 477,161k (± 0.01%) ~ 477,095k 477,207k p=0.810 n=6
Parse Time 2.99s (± 3.08%) 2.95s (± 2.34%) ~ 2.89s 3.04s p=0.466 n=6
Bind Time 0.97s (± 8.80%) 1.01s (± 8.19%) ~ 0.89s 1.07s p=0.517 n=6
Check Time 17.11s (± 0.51%) 17.15s (± 0.90%) ~ 17.03s 17.43s p=0.809 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.08s (± 0.42%) 21.11s (± 0.71%) ~ 21.01s 21.39s p=0.936 n=6
xstate - node (v18.10.0, x64)
Memory used 552,976k (± 0.02%) 552,892k (± 0.01%) ~ 552,824k 553,026k p=0.261 n=6
Parse Time 3.77s (± 0.34%) 3.76s (± 0.63%) ~ 3.73s 3.78s p=0.806 n=6
Bind Time 1.66s (± 0.59%) 1.66s (± 0.25%) ~ 1.65s 1.66s p=0.487 n=6
Check Time 2.82s (± 0.86%) 2.81s (± 0.49%) ~ 2.80s 2.84s p=0.191 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 8.34s (± 0.46%) 8.31s (± 0.39%) ~ 8.28s 8.36s p=0.170 n=6
Angular - node (v16.17.1, x64)
Memory used 361,688k (± 0.01%) 361,707k (± 0.01%) ~ 361,678k 361,729k p=0.261 n=6
Parse Time 3.52s (± 0.74%) 3.52s (± 0.47%) ~ 3.51s 3.55s p=0.563 n=6
Bind Time 1.17s (± 0.47%) 1.18s (± 0.64%) ~ 1.17s 1.19s p=0.476 n=6
Check Time 9.47s (± 0.46%) 9.51s (± 0.51%) ~ 9.46s 9.59s p=0.258 n=6
Emit Time 7.95s (± 0.41%) 7.96s (± 0.66%) ~ 7.92s 8.05s p=0.936 n=6
Total Time 22.11s (± 0.20%) 22.17s (± 0.41%) ~ 22.08s 22.30s p=0.336 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 193,615k (± 0.86%) 194,133k (± 0.89%) ~ 192,513k 195,740k p=0.575 n=6
Parse Time 1.60s (± 0.85%) 1.59s (± 1.08%) ~ 1.56s 1.61s p=0.934 n=6
Bind Time 0.82s (± 0.77%) 0.82s (± 0.92%) ~ 0.81s 0.83s p=0.718 n=6
Check Time 10.33s (± 0.69%) 10.26s (± 0.51%) ~ 10.20s 10.33s p=0.149 n=6
Emit Time 2.98s (± 0.84%) 2.99s (± 1.06%) ~ 2.95s 3.03s p=0.747 n=6
Total Time 15.73s (± 0.62%) 15.66s (± 0.45%) ~ 15.57s 15.77s p=0.195 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,737k (± 0.01%) 345,733k (± 0.01%) ~ 345,685k 345,764k p=1.000 n=6
Parse Time 2.71s (± 0.54%) 2.71s (± 0.56%) ~ 2.68s 2.72s p=0.511 n=6
Bind Time 1.08s (± 0.77%) 1.08s (± 0.48%) ~ 1.08s 1.09s p=0.923 n=6
Check Time 7.78s (± 0.47%) 7.76s (± 0.39%) ~ 7.72s 7.80s p=0.295 n=6
Emit Time 4.47s (± 1.13%) 4.46s (± 0.74%) ~ 4.42s 4.51s p=0.744 n=6
Total Time 16.04s (± 0.49%) 16.01s (± 0.28%) ~ 15.94s 16.07s p=0.518 n=6
TFS - node (v16.17.1, x64)
Memory used 300,025k (± 0.01%) 300,024k (± 0.01%) ~ 299,995k 300,056k p=0.873 n=6
Parse Time 2.16s (± 0.54%) 2.16s (± 1.04%) ~ 2.14s 2.20s p=0.285 n=6
Bind Time 1.24s (± 1.07%) 1.23s (± 0.80%) ~ 1.22s 1.24s p=0.437 n=6
Check Time 7.20s (± 0.47%) 7.20s (± 0.57%) ~ 7.12s 7.24s p=0.630 n=6
Emit Time 4.34s (± 0.58%) 4.34s (± 0.88%) ~ 4.31s 4.41s p=0.466 n=6
Total Time 14.94s (± 0.39%) 14.92s (± 0.50%) ~ 14.79s 15.01s p=0.936 n=6
material-ui - node (v16.17.1, x64)
Memory used 476,460k (± 0.00%) 476,480k (± 0.01%) ~ 476,437k 476,594k p=1.000 n=6
Parse Time 3.21s (± 0.87%) 3.21s (± 0.23%) ~ 3.20s 3.22s p=0.188 n=6
Bind Time 0.96s (± 1.61%) 0.95s (± 0.86%) ~ 0.93s 0.95s p=0.056 n=6
Check Time 18.25s (± 0.81%) 18.12s (± 0.29%) -0.13s (- 0.72%) 18.06s 18.19s p=0.037 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.43s (± 0.71%) 22.28s (± 0.30%) -0.15s (- 0.67%) 22.19s 22.37s p=0.037 n=6
xstate - node (v16.17.1, x64)
Memory used 550,604k (± 0.02%) 550,650k (± 0.02%) ~ 550,531k 550,789k p=0.689 n=6
Parse Time 3.93s (± 0.35%) 3.93s (± 0.21%) ~ 3.92s 3.94s p=0.933 n=6
Bind Time 1.76s (± 0.60%) 1.76s (± 0.51%) ~ 1.75s 1.77s p=0.452 n=6
Check Time 3.07s (± 0.34%) 3.07s (± 0.27%) ~ 3.06s 3.08s p=0.928 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 8.84s (± 0.28%) 8.85s (± 0.09%) ~ 8.84s 8.86s p=0.452 n=6
Angular - node (v14.15.1, x64)
Memory used 355,562k (± 0.00%) 355,556k (± 0.00%) ~ 355,547k 355,572k p=0.260 n=6
Parse Time 3.61s (± 0.76%) 3.60s (± 0.51%) ~ 3.58s 3.63s p=0.366 n=6
Bind Time 1.22s (± 0.86%) 1.22s (± 0.81%) ~ 1.21s 1.23s p=0.673 n=6
Check Time 9.91s (± 0.36%) 9.84s (± 0.48%) -0.07s (- 0.72%) 9.76s 9.89s p=0.024 n=6
Emit Time 8.37s (± 0.44%) 8.35s (± 0.63%) ~ 8.28s 8.41s p=0.630 n=6
Total Time 23.11s (± 0.19%) 23.00s (± 0.38%) -0.11s (- 0.46%) 22.84s 23.08s p=0.016 n=6
Compiler-Unions - node (v14.15.1, x64)
Memory used 187,799k (± 0.01%) 187,804k (± 0.02%) ~ 187,760k 187,845k p=0.810 n=6
Parse Time 1.59s (± 0.62%) 1.59s (± 0.26%) ~ 1.59s 1.60s p=0.487 n=6
Bind Time 0.84s (± 0.65%) 0.84s (± 0.65%) ~ 0.84s 0.85s p=1.000 n=6
Check Time 10.44s (± 0.53%) 10.42s (± 0.50%) ~ 10.36s 10.48s p=0.518 n=6
Emit Time 3.16s (± 0.93%) 3.13s (± 1.53%) ~ 3.06s 3.19s p=0.332 n=6
Total Time 16.03s (± 0.38%) 15.99s (± 0.57%) ~ 15.87s 16.09s p=0.334 n=6
Monaco - node (v14.15.1, x64)
Memory used 340,600k (± 0.01%) 340,618k (± 0.01%) ~ 340,580k 340,642k p=0.471 n=6
Parse Time 2.82s (± 0.53%) 2.81s (± 0.50%) ~ 2.79s 2.83s p=0.188 n=6
Bind Time 1.10s (± 0.94%) 1.09s (± 0.47%) ~ 1.09s 1.10s p=0.070 n=6
Check Time 8.13s (± 0.31%) 8.13s (± 0.46%) ~ 8.08s 8.18s p=0.808 n=6
Emit Time 4.69s (± 0.79%) 4.67s (± 0.25%) ~ 4.65s 4.68s p=0.505 n=6
Total Time 16.75s (± 0.24%) 16.71s (± 0.27%) ~ 16.64s 16.77s p=0.145 n=6
TFS - node (v14.15.1, x64)
Memory used 295,090k (± 0.00%) 295,096k (± 0.00%) ~ 295,086k 295,106k p=0.199 n=6
Parse Time 2.40s (± 0.78%) 2.39s (± 0.77%) ~ 2.36s 2.41s p=0.566 n=6
Bind Time 1.06s (± 0.38%) 1.06s (± 0.60%) ~ 1.05s 1.07s p=0.673 n=6
Check Time 7.53s (± 0.80%) 7.50s (± 0.55%) ~ 7.45s 7.54s p=0.746 n=6
Emit Time 4.27s (± 0.72%) 4.28s (± 0.82%) ~ 4.25s 4.35s p=0.683 n=6
Total Time 15.25s (± 0.48%) 15.23s (± 0.51%) ~ 15.11s 15.34s p=0.630 n=6
material-ui - node (v14.15.1, x64)
Memory used 471,995k (± 0.00%) 472,011k (± 0.00%) ~ 471,996k 472,029k p=0.199 n=6
Parse Time 3.35s (± 0.46%) 3.33s (± 0.70%) ~ 3.32s 3.38s p=0.050 n=6
Bind Time 0.99s (± 0.76%) 1.00s (± 0.55%) ~ 0.99s 1.00s p=0.476 n=6
Check Time 19.15s (± 0.43%) 19.07s (± 0.46%) ~ 18.98s 19.18s p=0.128 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.50s (± 0.34%) 23.40s (± 0.35%) ~ 23.32s 23.51s p=0.077 n=6
xstate - node (v14.15.1, x64)
Memory used 539,199k (± 0.01%) 539,193k (± 0.01%) ~ 539,140k 539,253k p=0.810 n=6
Parse Time 4.23s (± 0.53%) 4.19s (± 0.29%) -0.03s (- 0.75%) 4.18s 4.21s p=0.029 n=6
Bind Time 1.66s (± 0.70%) 1.65s (± 0.25%) ~ 1.65s 1.66s p=0.248 n=6
Check Time 3.19s (± 0.73%) 3.17s (± 0.74%) ~ 3.13s 3.19s p=0.288 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 9.17s (± 0.31%) 9.11s (± 0.36%) -0.06s (- 0.62%) 9.06s 9.15s p=0.016 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 53595 6
Baseline main 6

TSServer

Comparison Report - main..53595
Metric main 53595 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,397ms (± 0.57%) 2,389ms (± 0.37%) ~ 2,373ms 2,396ms p=0.334 n=6
Req 2 - geterr 5,548ms (± 0.54%) 5,545ms (± 0.63%) ~ 5,509ms 5,597ms p=0.936 n=6
Req 3 - references 338ms (± 0.57%) 338ms (± 1.00%) ~ 334ms 344ms p=0.567 n=6
Req 4 - navto 280ms (± 0.54%) 280ms (± 0.39%) ~ 278ms 281ms p=0.623 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 83ms (± 1.78%) 84ms (± 0.90%) ~ 83ms 85ms p=0.195 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,520ms (± 1.17%) 2,512ms (± 1.34%) ~ 2,469ms 2,546ms p=0.810 n=6
Req 2 - geterr 4,064ms (± 0.43%) 4,041ms (± 0.43%) ~ 4,022ms 4,062ms p=0.093 n=6
Req 3 - references 348ms (± 0.87%) 350ms (± 1.22%) ~ 344ms 356ms p=0.415 n=6
Req 4 - navto 290ms (± 0.52%) 289ms (± 0.62%) ~ 286ms 291ms p=0.676 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 (± 3.78%) 79ms (± 3.34%) ~ 75ms 81ms p=0.251 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,983ms (± 0.38%) 2,992ms (± 0.28%) ~ 2,983ms 3,006ms p=0.149 n=6
Req 2 - geterr 1,683ms (± 0.92%) 1,693ms (± 0.76%) ~ 1,679ms 1,710ms p=0.296 n=6
Req 3 - references 106ms (± 0.97%) 106ms (± 0.77%) ~ 105ms 107ms p=0.932 n=6
Req 4 - navto 355ms (± 0.23%) 355ms (± 0.61%) ~ 352ms 358ms p=0.934 n=6
Req 5 - completionInfo count 2,861 (± 0.00%) 2,861 (± 0.00%) ~ 2,861 2,861 p=1.000 n=6
Req 5 - completionInfo 382ms (± 1.96%) 393ms (± 4.53%) ~ 381ms 429ms p=0.149 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,512ms (± 0.41%) 2,495ms (± 0.58%) -18ms (- 0.70%) 2,472ms 2,510ms p=0.030 n=6
Req 2 - geterr 5,898ms (± 0.40%) 5,897ms (± 0.48%) ~ 5,873ms 5,951ms p=0.936 n=6
Req 3 - references 344ms (± 0.51%) 344ms (± 0.44%) ~ 342ms 346ms p=0.806 n=6
Req 4 - navto 278ms (± 0.23%) 278ms (± 0.29%) ~ 277ms 279ms p=0.432 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 74ms (± 1.48%) 74ms (± 1.33%) ~ 73ms 75ms p=0.865 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,682ms (± 0.10%) 2,671ms (± 0.45%) ~ 2,659ms 2,689ms p=0.148 n=6
Req 2 - geterr 4,425ms (± 0.55%) 4,436ms (± 0.53%) ~ 4,392ms 4,457ms p=0.230 n=6
Req 3 - references 365ms (± 0.41%) 363ms (± 0.30%) ~ 362ms 365ms p=0.054 n=6
Req 4 - navto 287ms (± 0.58%) 285ms (± 0.48%) ~ 284ms 287ms p=0.111 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 77ms (± 2.59%) 76ms (± 0.99%) ~ 75ms 77ms p=0.652 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,145ms (± 0.40%) 3,142ms (± 0.29%) ~ 3,131ms 3,157ms p=0.748 n=6
Req 2 - geterr 1,859ms (± 0.58%) 1,856ms (± 1.03%) ~ 1,833ms 1,886ms p=0.810 n=6
Req 3 - references 113ms (± 1.98%) 115ms (± 1.98%) ~ 112ms 118ms p=0.222 n=6
Req 4 - navto 341ms (± 0.44%) 341ms (± 0.39%) ~ 339ms 342ms p=0.492 n=6
Req 5 - completionInfo count 2,861 (± 0.00%) 2,861 (± 0.00%) ~ 2,861 2,861 p=1.000 n=6
Req 5 - completionInfo 395ms (± 0.76%) 397ms (± 1.04%) ~ 392ms 401ms p=0.418 n=6
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,605ms (± 0.53%) 2,593ms (± 0.24%) ~ 2,586ms 2,604ms p=0.092 n=6
Req 2 - geterr 6,368ms (± 0.69%) 6,325ms (± 0.42%) ~ 6,288ms 6,367ms p=0.093 n=6
Req 3 - references 364ms (± 0.45%) 361ms (± 0.90%) ~ 356ms 365ms p=0.255 n=6
Req 4 - navto 281ms (± 1.25%) 280ms (± 0.77%) ~ 277ms 283ms p=0.934 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 98ms (± 8.66%) 98ms (± 5.90%) ~ 89ms 102ms p=0.681 n=6
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,812ms (± 0.50%) 2,810ms (± 0.43%) ~ 2,796ms 2,832ms p=0.936 n=6
Req 2 - geterr 4,789ms (± 0.40%) 4,759ms (± 0.30%) -31ms (- 0.64%) 4,743ms 4,777ms p=0.030 n=6
Req 3 - references 373ms (± 0.58%) 371ms (± 0.26%) ~ 370ms 372ms p=0.118 n=6
Req 4 - navto 293ms (± 1.92%) 289ms (± 1.29%) ~ 285ms 296ms p=0.373 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 74ms (± 0.55%) 75ms (± 0.69%) ~ 74ms 75ms p=0.112 n=6
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 3,443ms (± 0.33%) 3,447ms (± 0.45%) ~ 3,423ms 3,466ms p=0.470 n=6
Req 2 - geterr 1,874ms (± 1.24%) 1,870ms (± 0.93%) ~ 1,847ms 1,898ms p=0.688 n=6
Req 3 - references 124ms (± 0.61%) 124ms (± 0.72%) ~ 123ms 125ms p=0.798 n=6
Req 4 - navto 370ms (± 0.32%) 372ms (± 0.57%) +2ms (+ 0.63%) 370ms 376ms p=0.040 n=6
Req 5 - completionInfo count 2,861 (± 0.00%) 2,861 (± 0.00%) ~ 2,861 2,861 p=1.000 n=6
Req 5 - completionInfo 410ms (± 0.91%) 408ms (± 1.03%) ~ 403ms 415ms p=0.260 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 53595 6
Baseline main 6

Startup

Comparison Report - main..53595
Metric main 53595 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 141.41ms (± 0.18%) 141.64ms (± 0.22%) +0.23ms (+ 0.16%) 140.73ms 146.78ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 226.40ms (± 0.15%) 226.07ms (± 0.19%) -0.33ms (- 0.15%) 224.82ms 231.95ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 228.39ms (± 0.17%) 228.37ms (± 0.23%) -0.03ms (- 0.01%) 226.92ms 235.08ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 209.13ms (± 0.17%) 208.86ms (± 0.21%) -0.27ms (- 0.13%) 207.52ms 215.44ms 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 53595 6
Baseline main 6

Developer Information:

Download Benchmark

@weswigham
Copy link
Member Author

Eh, a 0.75% improvement in node 16, but not 14 or 18? Weird. At least it's definitely not perf negative.

@weswigham
Copy link
Member Author

@typescript-bot run dt

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 30, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Branch only errors:

Package: convict
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/convict/convict-tests.ts:62:1
ERROR: 62:1  expect  TypeScript@local expected type to be:
  Config<{ foo: Foo; }>
got:
  Config<{ foo: Foo | { a: string; }; }>

    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.

@@ -24005,6 +23995,17 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (inInferTypeForHomomorphicMappedType) {
Copy link
Contributor

Choose a reason for hiding this comment

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

tangent q: is there any reason why this is a "global" flag and not something based on source/target identities? 🤔

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.

Range Error: Maximum call stack size exceeded while compiling our code

3 participants