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

Stop checking existing resolution now that we have concept of package ID #58528

Merged
merged 2 commits into from
May 14, 2024

Conversation

sheetalkamat
Copy link
Member

@sheetalkamat sheetalkamat commented May 13, 2024

This was added in #7775 when we didnt have deduplication logic So now just rely on the existing dedup logic for type Ref management.
This now follows exact same logic of module resolution and let the deduping take care of it. It also solves issue of when and how the type ref was resolved when they are same etc. Note that module resolution falls back to typeRef resolution on failure so right now you could still have a types in your program from two different versions. So this just streamlines it.

The test cases dont have package json and hence those are not deduped

This was added in #7775 when we didnt have deduplication logic
So now just rely on the existing dedup logic for type Ref management.
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels May 13, 2024
@sheetalkamat
Copy link
Member Author

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 13, 2024

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

Command Status Results
test top100 ✅ Started ✅ Results
test tsserver top100 ✅ Started
user test this ✅ Started ✅ Results
user test tsserver ✅ Started ✅ Results
run dt ✅ Started ✅ Results
perf test this ✅ Started 👀 Results
pack this ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 13, 2024

Hey @sheetalkamat, 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/161740/artifacts?artifactName=tgz&fileId=89DC396A30D5CD1DB9F3B251AAD24480862667009C8604DD315AF3CC5C24D28A02&fileName=/typescript-5.5.0-insiders.20240513.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/pr-build@5.5.0-pr-58528-2".;

@typescript-bot
Copy link
Collaborator

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@sheetalkamat Here are the results of running the user tests comparing main and refs/pull/58528/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"

Otherwise...

Everything looks good!

@typescript-bot
Copy link
Collaborator

@sheetalkamat Here are the results of running the user tests comparing main and refs/pull/58528/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

@sheetalkamat
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,154 62,154 ~ ~ ~ p=1.000 n=6
Types 50,248 50,248 ~ ~ ~ p=1.000 n=6
Memory used 192,832k (± 0.75%) 193,537k (± 0.93%) ~ 192,169k 195,884k p=0.471 n=6
Parse Time 1.54s (± 1.94%) 1.55s (± 2.14%) ~ 1.51s 1.60s p=0.627 n=6
Bind Time 0.86s (± 0.60%) 0.87s (± 0.94%) ~ 0.86s 0.88s p=0.523 n=6
Check Time 11.34s (± 0.56%) 11.29s (± 0.39%) ~ 11.26s 11.35s p=0.250 n=6
Emit Time 3.15s (± 1.20%) 3.17s (± 0.58%) ~ 3.15s 3.20s p=0.326 n=6
Total Time 16.89s (± 0.42%) 16.89s (± 0.41%) ~ 16.80s 16.99s p=1.000 n=6
angular-1 - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 944,110 944,110 ~ ~ ~ p=1.000 n=6
Types 407,140 407,140 ~ ~ ~ p=1.000 n=6
Memory used 1,222,076k (± 0.00%) 1,222,069k (± 0.00%) ~ 1,222,003k 1,222,149k p=0.630 n=6
Parse Time 8.12s (± 0.51%) 8.09s (± 0.44%) ~ 8.04s 8.13s p=0.225 n=6
Bind Time 2.25s (± 0.61%) 2.23s (± 0.52%) ~ 2.22s 2.25s p=0.062 n=6
Check Time 36.50s (± 0.59%) 36.48s (± 0.35%) ~ 36.33s 36.62s p=0.810 n=6
Emit Time 17.57s (± 0.31%) 17.44s (± 0.37%) -0.13s (- 0.73%) 17.34s 17.52s p=0.006 n=6
Total Time 64.44s (± 0.33%) 64.24s (± 0.24%) ~ 64.02s 64.44s p=0.126 n=6
mui-docs - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 1,961,349 1,961,349 ~ ~ ~ p=1.000 n=6
Types 696,910 696,910 ~ ~ ~ p=1.000 n=6
Memory used 1,778,018k (± 0.00%) 1,778,034k (± 0.00%) ~ 1,778,012k 1,778,073k p=0.471 n=6
Parse Time 9.85s (± 0.36%) 9.88s (± 0.34%) ~ 9.83s 9.93s p=0.225 n=6
Bind Time 3.38s (± 0.48%) 3.34s (± 0.59%) -0.03s (- 0.99%) 3.31s 3.36s p=0.011 n=6
Check Time 82.83s (± 0.57%) 82.84s (± 0.36%) ~ 82.46s 83.19s p=0.748 n=6
Emit Time 0.20s (± 2.54%) 0.20s (± 4.08%) ~ 0.20s 0.22s p=0.923 n=6
Total Time 96.25s (± 0.46%) 96.27s (± 0.32%) ~ 95.89s 96.61s p=0.936 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,221,149 1,221,131 -18 (- 0.00%) ~ ~ p=0.001 n=6
Types 259,495 259,488 -7 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 2,337,097k (± 0.03%) 2,420,866k (± 5.96%) ~ 2,336,642k 2,688,913k p=0.378 n=6
Parse Time 7.46s (± 1.58%) 7.49s (± 1.43%) ~ 7.38s 7.64s p=0.689 n=6
Bind Time 2.76s (± 0.53%) 2.74s (± 0.38%) ~ 2.73s 2.76s p=0.089 n=6
Check Time 49.32s (± 1.04%) 48.92s (± 0.69%) ~ 48.26s 49.20s p=0.230 n=6
Emit Time 3.95s (± 4.02%) 3.89s (± 2.28%) ~ 3.77s 3.97s p=0.575 n=6
Total Time 63.50s (± 0.82%) 63.05s (± 0.49%) -0.45s (- 0.72%) 62.43s 63.27s p=0.045 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,221,149 1,221,131 -18 (- 0.00%) ~ ~ p=0.001 n=6
Types 259,495 259,488 -7 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 2,438,027k (± 2.50%) 2,412,614k (± 0.02%) -25,413k (- 1.04%) 2,412,093k 2,413,154k p=0.045 n=6
Parse Time 6.26s (± 0.99%) 6.26s (± 1.43%) ~ 6.16s 6.40s p=0.936 n=6
Bind Time 2.03s (± 0.98%) 2.03s (± 0.58%) ~ 2.01s 2.04s p=1.000 n=6
Check Time 40.37s (± 0.42%) 40.25s (± 0.06%) ~ 40.21s 40.28s p=0.093 n=6
Emit Time 3.19s (± 5.10%) 3.13s (± 3.07%) ~ 3.02s 3.24s p=0.422 n=6
Total Time 51.86s (± 0.43%) 51.68s (± 0.30%) ~ 51.52s 51.86s p=0.230 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 256,719 256,712 -7 (- 0.00%) ~ ~ p=0.001 n=6
Types 104,579 104,573 -6 (- 0.01%) ~ ~ p=0.001 n=6
Memory used 425,904k (± 0.01%) 425,882k (± 0.02%) ~ 425,806k 426,031k p=0.128 n=6
Parse Time 2.78s (± 0.49%) 2.79s (± 0.77%) ~ 2.77s 2.83s p=0.410 n=6
Bind Time 1.10s (± 0.99%) 1.09s (± 0.47%) ~ 1.09s 1.10s p=0.321 n=6
Check Time 15.18s (± 0.43%) 15.15s (± 0.25%) ~ 15.09s 15.20s p=0.572 n=6
Emit Time 1.15s (± 1.62%) 1.14s (± 1.32%) ~ 1.13s 1.17s p=0.744 n=6
Total Time 20.21s (± 0.36%) 20.19s (± 0.22%) ~ 20.11s 20.23s p=0.470 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,575 224,575 ~ ~ ~ p=1.000 n=6
Types 93,785 93,785 ~ ~ ~ p=1.000 n=6
Memory used 369,838k (± 0.02%) 369,884k (± 0.02%) ~ 369,802k 369,991k p=0.297 n=6
Parse Time 2.83s (± 0.45%) 2.85s (± 1.08%) ~ 2.81s 2.88s p=0.516 n=6
Bind Time 1.59s (± 0.66%) 1.58s (± 0.76%) ~ 1.57s 1.60s p=0.868 n=6
Check Time 15.71s (± 0.36%) 15.69s (± 0.34%) ~ 15.62s 15.78s p=0.423 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.13s (± 0.30%) 20.12s (± 0.19%) ~ 20.07s 20.17s p=0.688 n=6
vscode - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,822,415 2,822,415 ~ ~ ~ p=1.000 n=6
Types 957,525 957,525 ~ ~ ~ p=1.000 n=6
Memory used 2,994,985k (± 0.00%) 2,994,920k (± 0.00%) -66k (- 0.00%) 2,994,795k 2,994,959k p=0.045 n=6
Parse Time 13.84s (± 0.27%) 13.81s (± 0.21%) ~ 13.77s 13.85s p=0.226 n=6
Bind Time 4.15s (± 0.15%) 4.14s (± 0.42%) ~ 4.12s 4.17s p=0.392 n=6
Check Time 73.33s (± 0.45%) 73.26s (± 0.14%) ~ 73.13s 73.43s p=0.688 n=6
Emit Time 23.57s (± 1.14%) 23.51s (± 0.57%) ~ 23.32s 23.70s p=1.000 n=6
Total Time 114.88s (± 0.46%) 114.72s (± 0.14%) ~ 114.48s 114.97s p=0.810 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 265,866 265,866 ~ ~ ~ p=1.000 n=6
Types 108,401 108,401 ~ ~ ~ p=1.000 n=6
Memory used 410,589k (± 0.03%) 410,509k (± 0.01%) ~ 410,450k 410,599k p=0.093 n=6
Parse Time 3.19s (± 0.84%) 3.20s (± 0.43%) ~ 3.18s 3.22s p=0.463 n=6
Bind Time 1.41s (± 0.83%) 1.39s (± 1.33%) ~ 1.37s 1.42s p=0.164 n=6
Check Time 14.40s (± 0.30%) 14.36s (± 0.33%) ~ 14.29s 14.42s p=0.373 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 18.99s (± 0.23%) 18.96s (± 0.24%) ~ 18.88s 19.01s p=0.261 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 524,639 524,639 ~ ~ ~ p=1.000 n=6
Types 178,906 178,906 ~ ~ ~ p=1.000 n=6
Memory used 462,712k (± 0.02%) 462,688k (± 0.01%) ~ 462,642k 462,818k p=0.471 n=6
Parse Time 3.12s (± 1.33%) 3.11s (± 0.98%) ~ 3.07s 3.15s p=0.935 n=6
Bind Time 1.16s (± 1.44%) 1.16s (± 0.90%) ~ 1.15s 1.18s p=0.357 n=6
Check Time 18.21s (± 0.78%) 18.24s (± 0.70%) ~ 18.04s 18.44s p=0.575 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.48s (± 0.70%) 22.52s (± 0.59%) ~ 22.33s 22.74s p=1.000 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

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 3,353ms (± 5.07%) 3,421ms (± 0.47%) ~ 3,397ms 3,437ms p=0.575 n=6
Req 2 - geterr 7,558ms (± 0.96%) 7,600ms (± 0.75%) ~ 7,510ms 7,667ms p=0.378 n=6
Req 3 - references 421ms (± 7.69%) 433ms (± 1.12%) ~ 428ms 439ms p=1.000 n=6
Req 4 - navto 333ms (± 7.78%) 342ms (± 0.44%) ~ 341ms 345ms p=0.199 n=6
Req 5 - completionInfo count 1,357 1,357 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 112ms (± 8.94%) 113ms (± 1.46%) ~ 111ms 115ms p=0.625 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 3,209ms (± 9.74%) 2,973ms (± 3.29%) ~ 2,917ms 3,169ms p=0.066 n=6
Req 2 - geterr 5,148ms (±11.88%) 4,784ms (± 9.42%) ~ 4,582ms 5,704ms p=0.810 n=6
Req 3 - references 393ms (± 9.77%) 379ms (± 8.90%) ~ 359ms 446ms p=0.419 n=6
Req 4 - navto 301ms (±10.57%) 291ms (± 8.12%) ~ 278ms 339ms p=1.000 n=6
Req 5 - completionInfo count 1,519 1,519 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 100ms (± 9.42%) 103ms (±13.59%) ~ 87ms 124ms p=0.870 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen 5,110ms (± 0.37%) 5,112ms (± 0.33%) ~ 5,099ms 5,139ms p=0.748 n=6
Req 2 - geterr 1,129ms (± 1.08%) 1,137ms (± 1.13%) ~ 1,111ms 1,147ms p=0.258 n=6
Req 3 - references 89ms (± 4.43%) 87ms (± 3.97%) ~ 84ms 93ms p=0.511 n=6
Req 4 - navto 455ms (± 0.98%) 449ms (± 3.16%) ~ 420ms 458ms p=0.687 n=6
Req 5 - completionInfo count 3,413 3,413 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 864ms (± 2.46%) 851ms (± 1.40%) ~ 830ms 862ms p=0.332 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstate-main-1-tsserver - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 188.99ms (± 0.15%) 189.16ms (± 0.17%) +0.17ms (+ 0.09%) 187.32ms 193.38ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 361.91ms (± 0.27%) 362.02ms (± 0.28%) ~ 353.66ms 371.64ms p=0.173 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 236.82ms (± 0.16%) 236.56ms (± 0.14%) -0.26ms (- 0.11%) 234.87ms 239.24ms p=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 286.03ms (± 0.30%) 285.76ms (± 0.32%) -0.27ms (- 0.09%) 278.66ms 293.32ms p=0.000 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@sheetalkamat Here are the results of running the top 400 repos comparing main and refs/pull/58528/merge:

Everything looks good!

@sheetalkamat sheetalkamat marked this pull request as ready for review May 14, 2024 16:59
@@ -12,10 +12,14 @@ declare var foo: any;

=== /node_modules/foo/node_modules/alpha/index.d.ts ===
declare var alpha: any;
>alpha : Symbol(alpha, Decl(index.d.ts, 0, 11))
>alpha : Symbol(alpha, Decl(index.d.ts, 0, 11), Decl(index.d.ts, 0, 11))
Copy link
Member Author

Choose a reason for hiding this comment

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

These didnt have package.json so didnt get deduped. But I added test case 4b and 5b where there is package.json

Comment on lines +19 to +23
==== /node_modules/bar/node_modules/alpha/index.d.ts (1 errors) ====
declare var alpha: {};
~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'alpha' must be of type 'any', but here has type '{}'.
!!! related TS6203 /node_modules/foo/node_modules/alpha/index.d.ts:1:13: 'alpha' was also declared here.
Copy link
Member

Choose a reason for hiding this comment

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

I was going to say "the old message seemed useful because it said where the dupe was", but I guess this related line would be enough. Though it's moderately a shame to lose a message that gives a potential solution.

Copy link
Member Author

Choose a reason for hiding this comment

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

The things work much better where you could have two typings that dont add to global and used by two packages and hence two different versions. This handles that well. We have this issue with module resolution. The only message we gave was with typeRef and it wasnt correct checking either so i feel better removing this custom logic for typeRef only and allows packages to use typeRef of different versions if they dont add conflicting global info.

@sheetalkamat sheetalkamat merged commit ef01ea1 into main May 14, 2024
28 checks passed
@sheetalkamat sheetalkamat deleted the stopCheckingConflictingDefs branch May 14, 2024 17:30
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.

None yet

3 participants