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

Narrow down non-const enity name expressions within element access expressions #56392

Conversation

Andarist
Copy link
Contributor

an experiment to fix #51368 . I wonder what the perf tests show for this (cc @jakebailey ) 😉

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 14, 2023
@jakebailey
Copy link
Member

Fails the self check so I'm going to assume that it'll break in testing; can run once you've had a chance to look.

@fatcerberus
Copy link

To be clear, this isn't a general fix for #56389, correct?

@Andarist
Copy link
Contributor Author

Yeah, it isn't. I specifically only looked into what @DetachHead mentioned here

@sandersn sandersn added the Experiment A fork with an experimental idea which might not make it into master label Nov 29, 2023
@Andarist Andarist marked this pull request as draft December 26, 2023 17:48
@Andarist Andarist marked this pull request as ready for review December 28, 2023 22:59
@Andarist
Copy link
Contributor Author

@jakebailey I fixed the self-check here. Would you mind running the perf suite? :)

Comment on lines +2838 to +2840
if (rootDeclaration.kind !== SyntaxKind.VariableDeclaration) {
return true;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: recheck correctness here

@jakebailey
Copy link
Member

@typescript-bot test top200
@typescript-bot user test this
@typescript-bot run dt

@typescript-bot perf test this
@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 4, 2024

Heya @jakebailey, I've started to run the regular perf test suite on this PR at 5d49f98. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 4, 2024

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 4, 2024

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 4, 2024

Heya @jakebailey, I've started to run the tarball bundle task on this PR at 5d49f98. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 4, 2024

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 4, 2024

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/159261/artifacts?artifactName=tgz&fileId=A10C51230D65ED8DD9ABAA7E144F16A014B03A2C082E67DD7993C0F756E4E4C402&fileName=/typescript-5.4.0-insiders.20240104.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.4.0-pr-56392-10".;

@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

puppeteer

packages/browsers/test/src/tsconfig.json

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 295,439k (± 0.01%) 295,546k (± 0.01%) +107k (+ 0.04%) 295,498k 295,572k p=0.008 n=6
Parse Time 2.65s (± 0.21%) 2.65s (± 0.19%) ~ 2.64s 2.65s p=0.640 n=6
Bind Time 0.82s (± 0.00%) 0.82s (± 0.50%) ~ 0.82s 0.83s p=0.405 n=6
Check Time 8.14s (± 0.08%) 8.16s (± 0.41%) ~ 8.11s 8.21s p=0.097 n=6
Emit Time 7.10s (± 0.43%) 7.10s (± 0.23%) ~ 7.08s 7.12s p=0.745 n=6
Total Time 18.71s (± 0.16%) 18.73s (± 0.23%) ~ 18.66s 18.78s p=0.296 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 193,464k (± 1.56%) 192,547k (± 1.22%) ~ 191,548k 197,344k p=0.378 n=6
Parse Time 1.35s (± 1.62%) 1.35s (± 1.96%) ~ 1.30s 1.38s p=0.732 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 0.57%) ~ 0.72s 0.73s p=0.405 n=6
Check Time 9.27s (± 0.33%) 9.26s (± 0.46%) ~ 9.19s 9.30s p=0.870 n=6
Emit Time 2.61s (± 0.29%) 2.62s (± 0.62%) ~ 2.60s 2.64s p=0.454 n=6
Total Time 13.95s (± 0.23%) 13.94s (± 0.36%) ~ 13.85s 13.99s p=0.747 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,413k (± 0.00%) 347,471k (± 0.01%) +58k (+ 0.02%) 347,432k 347,505k p=0.005 n=6
Parse Time 2.46s (± 0.36%) 2.46s (± 0.79%) ~ 2.43s 2.49s p=0.801 n=6
Bind Time 0.93s (± 0.56%) 0.93s (± 0.56%) ~ 0.92s 0.93s p=1.000 n=6
Check Time 6.88s (± 0.33%) 6.96s (± 0.36%) +0.08s (+ 1.21%) 6.93s 6.99s p=0.005 n=6
Emit Time 4.07s (± 0.50%) 4.05s (± 0.63%) ~ 4.02s 4.08s p=0.222 n=6
Total Time 14.33s (± 0.28%) 14.40s (± 0.38%) +0.07s (+ 0.49%) 14.34s 14.49s p=0.043 n=6
TFS - node (v18.15.0, x64)
Memory used 302,726k (± 0.00%) 302,868k (± 0.01%) +142k (+ 0.05%) 302,852k 302,895k p=0.005 n=6
Parse Time 1.99s (± 0.45%) 1.99s (± 0.82%) ~ 1.98s 2.02s p=0.803 n=6
Bind Time 1.01s (± 1.22%) 1.00s (± 1.22%) ~ 0.99s 1.02s p=1.000 n=6
Check Time 6.29s (± 0.31%) 6.39s (± 0.39%) +0.11s (+ 1.67%) 6.36s 6.42s p=0.005 n=6
Emit Time 3.58s (± 0.56%) 3.57s (± 0.39%) ~ 3.56s 3.59s p=0.744 n=6
Total Time 12.87s (± 0.28%) 12.97s (± 0.29%) +0.10s (+ 0.80%) 12.91s 13.02s p=0.006 n=6
material-ui - node (v18.15.0, x64)
Memory used 506,808k (± 0.01%) 506,828k (± 0.01%) ~ 506,795k 506,868k p=0.230 n=6
Parse Time 2.58s (± 0.53%) 2.58s (± 0.47%) ~ 2.57s 2.60s p=0.410 n=6
Bind Time 0.99s (± 0.52%) 0.99s (± 0.82%) ~ 0.98s 1.00s p=0.140 n=6
Check Time 16.91s (± 0.37%) 16.96s (± 0.14%) ~ 16.93s 16.99s p=0.090 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.48s (± 0.32%) 20.54s (± 0.13%) ~ 20.50s 20.58s p=0.078 n=6
xstate - node (v18.15.0, x64)
Memory used 512,914k (± 0.01%) 512,850k (± 0.01%) ~ 512,773k 512,906k p=0.066 n=6
Parse Time 3.28s (± 0.31%) 3.27s (± 0.27%) ~ 3.26s 3.28s p=0.273 n=6
Bind Time 1.54s (± 0.36%) 1.54s (± 0.49%) ~ 1.53s 1.55s p=0.137 n=6
Check Time 2.83s (± 0.73%) 2.81s (± 0.49%) ~ 2.79s 2.82s p=0.052 n=6
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) ~ 0.07s 0.07s p=1.000 n=6
Total Time 7.71s (± 0.35%) 7.68s (± 0.27%) ~ 7.66s 7.71s p=0.064 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • xstate - 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 2,344ms (± 0.83%) 2,353ms (± 0.63%) ~ 2,334ms 2,371ms p=0.296 n=6
Req 2 - geterr 5,405ms (± 1.15%) 5,466ms (± 1.34%) +61ms (+ 1.13%) 5,400ms 5,572ms p=0.045 n=6
Req 3 - references 324ms (± 0.42%) 324ms (± 0.74%) ~ 321ms 328ms p=0.806 n=6
Req 4 - navto 276ms (± 1.16%) 274ms (± 0.95%) ~ 270ms 277ms p=0.287 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 89ms (± 6.71%) 92ms (± 4.76%) ~ 84ms 95ms p=0.413 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,470ms (± 0.92%) 2,490ms (± 1.33%) ~ 2,455ms 2,532ms p=0.230 n=6
Req 2 - geterr 4,180ms (± 1.98%) 4,097ms (± 1.67%) ~ 4,056ms 4,235ms p=0.149 n=6
Req 3 - references 336ms (± 1.34%) 339ms (± 1.28%) ~ 333ms 343ms p=0.420 n=6
Req 4 - navto 285ms (± 1.27%) 286ms (± 1.02%) ~ 284ms 292ms p=0.216 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 83ms (± 6.55%) 90ms (± 1.37%) 🔻+6ms (+ 7.62%) 87ms 90ms p=0.026 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,600ms (± 0.57%) 2,613ms (± 0.35%) ~ 2,601ms 2,621ms p=0.172 n=6
Req 2 - geterr 1,729ms (± 2.74%) 1,741ms (± 1.57%) ~ 1,703ms 1,769ms p=0.873 n=6
Req 3 - references 116ms (± 8.61%) 112ms (±10.30%) ~ 100ms 123ms p=0.462 n=6
Req 4 - navto 365ms (± 0.27%) 368ms (± 1.42%) ~ 364ms 378ms p=0.203 n=6
Req 5 - completionInfo count 2,073 (± 0.00%) 2,073 (± 0.00%) ~ 2,073 2,073 p=1.000 n=6
Req 5 - completionInfo 309ms (± 1.70%) 310ms (± 0.80%) ~ 307ms 313ms p=0.685 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)
  • xstateTSServer - 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 153.63ms (± 0.20%) 153.57ms (± 0.20%) ~ 152.55ms 157.42ms p=0.087 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 229.14ms (± 0.15%) 228.88ms (± 0.16%) -0.26ms (- 0.11%) 227.60ms 234.31ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 230.28ms (± 0.20%) 230.30ms (± 0.19%) ~ 228.60ms 233.66ms p=0.784 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 230.60ms (± 0.21%) 230.72ms (± 0.20%) +0.12ms (+ 0.05%) 229.04ms 237.79ms p=0.003 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

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 top-repos suite comparing main and refs/pull/56392/merge:

Everything looks good!

@Andarist
Copy link
Contributor Author

superseded by #57847

@Andarist Andarist closed this Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Experiment A fork with an experimental idea which might not make it into master For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

narrowing object by property doesn't work if key isn't a const
5 participants