Skip to content

Avoid checking class expressions more than once #59610

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

When investigating #52892 I noticed that a class expression in the circular situation could be checked more than once.

I couldn't recognize any issue being fixed by this. I manually confirmed that various diagnostics could be created by this wrapped code more than once... but DiagnosticCollection['add'] uses a deduplication mechanism so this can't be observed.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Aug 12, 2024
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@DanielRosenwasser
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 12, 2024

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
Copy link
Collaborator

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser
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,153 62,153 ~ ~ ~ p=1.000 n=6
Types 50,242 50,242 ~ ~ ~ p=1.000 n=6
Memory used 193,539k (± 0.96%) 192,933k (± 0.75%) ~ 192,311k 195,877k p=0.689 n=6
Parse Time 1.57s (± 0.94%) 1.57s (± 0.77%) ~ 1.55s 1.58s p=0.564 n=6
Bind Time 0.86s (± 1.04%) 0.86s (± 0.88%) ~ 0.85s 0.87s p=0.798 n=6
Check Time 11.37s (± 0.52%) 11.39s (± 0.50%) ~ 11.34s 11.50s p=0.686 n=6
Emit Time 3.24s (± 0.23%) 3.24s (± 0.86%) ~ 3.21s 3.29s p=1.000 n=6
Total Time 17.04s (± 0.41%) 17.05s (± 0.39%) ~ 16.98s 17.17s p=0.810 n=6
angular-1 - node (v18.15.0, x64)
Errors 7 7 ~ ~ ~ p=1.000 n=6
Symbols 945,757 945,757 ~ ~ ~ p=1.000 n=6
Types 410,045 410,045 ~ ~ ~ p=1.000 n=6
Memory used 1,222,542k (± 0.00%) 1,222,558k (± 0.00%) ~ 1,222,519k 1,222,587k p=0.575 n=6
Parse Time 6.65s (± 0.42%) 6.64s (± 0.28%) ~ 6.62s 6.66s p=0.804 n=6
Bind Time 1.87s (± 0.29%) 1.86s (± 0.44%) ~ 1.85s 1.87s p=0.859 n=6
Check Time 31.12s (± 0.48%) 31.08s (± 0.26%) ~ 30.96s 31.21s p=0.521 n=6
Emit Time 14.92s (± 0.79%) 14.92s (± 0.83%) ~ 14.76s 15.08s p=0.687 n=6
Total Time 54.55s (± 0.30%) 54.50s (± 0.18%) ~ 54.37s 54.61s p=0.520 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,491,074 2,491,074 ~ ~ ~ p=1.000 n=6
Types 1,013,347 1,013,347 ~ ~ ~ p=1.000 n=6
Memory used 2,498,062k (± 0.00%) 2,498,085k (± 0.00%) ~ 2,498,009k 2,498,177k p=0.298 n=6
Parse Time 9.24s (± 0.35%) 9.24s (± 0.34%) ~ 9.19s 9.28s p=0.571 n=6
Bind Time 2.18s (± 0.19%) 2.18s (± 0.47%) ~ 2.17s 2.20s p=0.924 n=6
Check Time 75.86s (± 0.47%) 75.69s (± 0.46%) ~ 75.20s 76.12s p=0.298 n=6
Emit Time 0.28s (± 2.26%) 0.28s (± 2.70%) ~ 0.27s 0.29s p=0.718 n=6
Total Time 87.56s (± 0.40%) 87.39s (± 0.43%) ~ 86.87s 87.82s p=0.378 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,229,669 1,229,670 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 264,082 264,082 ~ ~ ~ p=1.000 n=6
Memory used 2,468,783k (±11.76%) 2,349,859k (± 0.04%) ~ 2,348,974k 2,351,171k p=0.298 n=6
Parse Time 5.00s (± 1.31%) 4.97s (± 0.59%) ~ 4.92s 5.01s p=0.378 n=6
Bind Time 1.87s (± 0.68%) 1.89s (± 0.67%) +0.02s (+ 1.07%) 1.87s 1.90s p=0.040 n=6
Check Time 34.59s (± 0.69%) 34.59s (± 0.14%) ~ 34.52s 34.65s p=0.872 n=6
Emit Time 3.29s (± 0.76%) 3.30s (± 0.72%) ~ 3.27s 3.32s p=0.421 n=6
Total Time 44.77s (± 0.59%) 44.77s (± 0.15%) ~ 44.67s 44.87s p=0.521 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,229,669 1,229,670 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 264,082 264,082 ~ ~ ~ p=1.000 n=6
Memory used 2,424,114k (± 0.01%) 2,423,804k (± 0.01%) ~ 2,423,513k 2,424,053k p=0.128 n=6
Parse Time 5.15s (± 0.57%) 5.14s (± 0.58%) ~ 5.10s 5.16s p=1.000 n=6
Bind Time 1.69s (± 0.45%) 1.69s (± 0.48%) ~ 1.68s 1.70s p=0.729 n=6
Check Time 35.06s (± 0.32%) 35.08s (± 0.30%) ~ 34.91s 35.21s p=0.936 n=6
Emit Time 3.36s (± 1.05%) 3.37s (± 0.84%) ~ 3.33s 3.41s p=0.470 n=6
Total Time 45.26s (± 0.25%) 45.27s (± 0.16%) ~ 45.16s 45.35s p=0.936 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 256,825 256,826 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 105,580 105,580 ~ ~ ~ p=1.000 n=6
Memory used 429,127k (± 0.05%) 429,056k (± 0.01%) ~ 429,022k 429,125k p=0.575 n=6
Parse Time 4.18s (± 0.72%) 4.17s (± 0.46%) ~ 4.15s 4.20s p=0.807 n=6
Bind Time 1.62s (± 0.39%) 1.62s (± 1.82%) ~ 1.57s 1.65s p=0.802 n=6
Check Time 22.25s (± 0.13%) 22.27s (± 0.27%) ~ 22.17s 22.36s p=0.368 n=6
Emit Time 2.06s (± 1.29%) 2.05s (± 0.37%) ~ 2.04s 2.06s p=0.869 n=6
Total Time 30.10s (± 0.19%) 30.10s (± 0.22%) ~ 30.00s 30.17s p=0.936 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 225,018 225,018 ~ ~ ~ p=1.000 n=6
Types 94,245 94,245 ~ ~ ~ p=1.000 n=6
Memory used 370,234k (± 0.03%) 370,110k (± 0.01%) -124k (- 0.03%) 370,026k 370,146k p=0.045 n=6
Parse Time 2.75s (± 1.16%) 2.75s (± 1.14%) ~ 2.71s 2.79s p=0.809 n=6
Bind Time 1.56s (± 0.48%) 1.56s (± 0.63%) ~ 1.55s 1.57s p=1.000 n=6
Check Time 15.68s (± 0.17%) 15.65s (± 0.29%) ~ 15.59s 15.72s p=0.199 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 19.99s (± 0.18%) 19.96s (± 0.18%) ~ 19.90s 20.00s p=0.256 n=6
vscode - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,999,114 2,999,114 ~ ~ ~ p=1.000 n=6
Types 1,033,196 1,033,182 -14 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 3,124,370k (± 0.00%) 3,124,335k (± 0.00%) ~ 3,124,240k 3,124,413k p=0.378 n=6
Parse Time 13.83s (± 0.40%) 13.82s (± 0.38%) ~ 13.74s 13.86s p=0.872 n=6
Bind Time 4.32s (± 1.94%) 4.31s (± 2.36%) ~ 4.23s 4.51s p=0.683 n=6
Check Time 79.69s (± 0.38%) 79.57s (± 0.60%) ~ 79.12s 80.41s p=0.471 n=6
Emit Time 20.47s (± 0.87%) 20.27s (± 0.36%) ~ 20.17s 20.36s p=0.078 n=6
Total Time 118.31s (± 0.32%) 117.96s (± 0.38%) ~ 117.48s 118.69s p=0.128 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 274,227 274,208 -19 (- 0.01%) ~ ~ p=0.001 n=6
Types 111,803 111,642 -161 (- 0.14%) ~ ~ p=0.001 n=6
Memory used 420,646k (± 0.02%) 420,438k (± 0.02%) -208k (- 0.05%) 420,369k 420,561k p=0.008 n=6
Parse Time 4.89s (± 0.60%) 4.89s (± 0.53%) ~ 4.85s 4.92s p=1.000 n=6
Bind Time 2.12s (± 0.64%) 2.15s (± 0.48%) +0.03s (+ 1.41%) 2.14s 2.17s p=0.013 n=6
Check Time 21.21s (± 0.16%) 21.24s (± 0.51%) ~ 21.06s 21.37s p=0.520 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 28.23s (± 0.12%) 28.28s (± 0.41%) ~ 28.11s 28.44s p=0.334 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 540,779 540,779 ~ ~ ~ p=1.000 n=6
Types 177,884 177,884 ~ ~ ~ p=1.000 n=6
Memory used 483,281k (± 0.01%) 483,285k (± 0.01%) ~ 483,201k 483,386k p=0.936 n=6
Parse Time 4.27s (± 0.57%) 4.26s (± 0.52%) ~ 4.23s 4.29s p=0.571 n=6
Bind Time 1.55s (± 0.63%) 1.54s (± 1.04%) ~ 1.52s 1.56s p=0.446 n=6
Check Time 22.36s (± 0.28%) 22.39s (± 0.47%) ~ 22.26s 22.56s p=0.568 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 28.17s (± 0.21%) 28.19s (± 0.38%) ~ 28.06s 28.37s 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

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

3 participants