Skip to content

Drop deferredNodes after checking them all. #52606

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

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Feb 4, 2023

Test to see if we can free up some memory once a file is fully type-checked.

Based on comment from #52605 (comment)

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Feb 4, 2023
@DanielRosenwasser
Copy link
Member Author

@typescript-bot perf test this faster

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 4, 2023

Heya @DanielRosenwasser, I've started to run the abridged perf test suite on this PR at 8bc58c0. 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:

Comparison Report - main..52606

Metric main 52606 Delta Best Worst p-value
Angular - node (v16.17.1, x64)
Memory used 359,220k (± 0.01%) 358,938k (± 0.00%) -281k (- 0.08%) 358,923k 358,951k p=0.005 n=6
Parse Time 4.18s (± 0.38%) 4.17s (± 0.12%) ~ 4.17s 4.18s p=0.418 n=6
Bind Time 1.23s (± 0.00%) 1.22s (± 0.52%) -0.01s (- 0.81%) 1.21s 1.23s p=0.008 n=6
Check Time 9.47s (± 0.31%) 9.46s (± 0.18%) ~ 9.44s 9.49s p=0.515 n=6
Emit Time 8.05s (± 0.16%) 8.08s (± 0.37%) ~ 8.04s 8.12s p=0.142 n=6
Total Time 22.93s (± 0.09%) 22.93s (± 0.15%) ~ 22.88s 22.97s p=1.000 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 193,990k (± 0.03%) 194,513k (± 0.68%) ~ 193,901k 197,219k p=0.810 n=6
Parse Time 1.80s (± 0.46%) 1.80s (± 0.76%) ~ 1.78s 1.82s p=1.000 n=6
Bind Time 0.85s (± 0.48%) 0.85s (± 0.89%) ~ 0.84s 0.86s p=1.000 n=6
Check Time 10.45s (± 0.81%) 10.44s (± 0.44%) ~ 10.38s 10.52s p=0.808 n=6
Emit Time 3.06s (± 0.96%) 3.06s (± 0.96%) ~ 3.02s 3.10s p=0.622 n=6
Total Time 16.17s (± 0.54%) 16.15s (± 0.53%) ~ 16.03s 16.29s p=0.810 n=6
Monaco - node (v16.17.1, x64)
Memory used 343,278k (± 0.01%) 343,155k (± 0.01%) -124k (- 0.04%) 343,111k 343,178k p=0.005 n=6
Parse Time 3.15s (± 1.13%) 3.17s (± 1.91%) ~ 3.10s 3.27s p=0.467 n=6
Bind Time 1.12s (± 0.56%) 1.11s (± 0.00%) -0.01s (- 0.89%) 1.11s 1.11s p=0.008 n=6
Check Time 7.72s (± 0.31%) 7.74s (± 0.34%) ~ 7.71s 7.78s p=0.260 n=6
Emit Time 4.53s (± 0.61%) 4.52s (± 0.50%) ~ 4.48s 4.54s p=0.467 n=6
Total Time 16.52s (± 0.30%) 16.53s (± 0.32%) ~ 16.45s 16.61s p=0.687 n=6
TFS - node (v16.17.1, x64)
Memory used 299,769k (± 0.01%) 299,681k (± 0.01%) -88k (- 0.03%) 299,665k 299,703k p=0.005 n=6
Parse Time 2.49s (± 2.15%) 2.49s (± 1.18%) ~ 2.44s 2.53s p=0.936 n=6
Bind Time 1.26s (± 0.41%) 1.26s (± 0.96%) ~ 1.25s 1.28s p=0.533 n=6
Check Time 7.21s (± 0.47%) 7.22s (± 0.34%) ~ 7.19s 7.26s p=0.420 n=6
Emit Time 4.23s (± 0.86%) 4.24s (± 0.58%) ~ 4.22s 4.29s p=0.687 n=6
Total Time 15.18s (± 0.75%) 15.20s (± 0.20%) ~ 15.15s 15.24s p=1.000 n=6
material-ui - node (v16.17.1, x64)
Memory used 476,134k (± 0.01%) 475,946k (± 0.01%) -188k (- 0.04%) 475,905k 475,975k p=0.005 n=6
Parse Time 3.71s (± 0.24%) 3.71s (± 0.28%) ~ 3.70s 3.73s p=0.673 n=6
Bind Time 1.02s (± 0.00%) 1.02s (± 0.00%) ~ 1.02s 1.02s p=1.000 n=6
Check Time 18.13s (± 0.23%) 18.18s (± 0.32%) ~ 18.12s 18.24s p=0.127 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.86s (± 0.17%) 22.92s (± 0.26%) ~ 22.85s 22.98s p=0.090 n=6
xstate - node (v16.17.1, x64)
Memory used 546,762k (± 0.02%) 546,701k (± 0.02%) ~ 546,601k 546,876k p=0.471 n=6
Parse Time 4.75s (± 0.35%) 4.76s (± 0.25%) ~ 4.75s 4.78s p=0.459 n=6
Bind Time 1.81s (± 3.98%) 1.81s (± 4.13%) ~ 1.66s 1.85s p=0.507 n=6
Check Time 3.08s (± 3.26%) 3.08s (± 2.94%) ~ 3.02s 3.26s p=1.000 n=6
Emit Time 0.09s (± 4.45%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=0.405 n=6
Total Time 9.74s (± 0.56%) 9.74s (± 0.35%) ~ 9.70s 9.80s p=0.872 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 (v16.17.1, x64)
Scenarios
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
Benchmark Name Iterations
Current 52606 6
Baseline main 6

Developer Information:

Download Benchmark

@DanielRosenwasser DanielRosenwasser force-pushed the dropDeferredNodesPostCheck branch from 8bc58c0 to a279740 Compare February 4, 2023 22:01
@DanielRosenwasser DanielRosenwasser marked this pull request as ready for review February 7, 2023 21:37
Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

It's weird, because we can end up building up the list of deferred nodes piecewise while doing work requested for random other files, but once the file's checked it's definitely safe to discard the list - we certainly won't be referring to it again, anyway. We could probably clear out our unused identifier cache post-source-file-check, too, if we were a bit smarter about how we went about regenerating a list of unused identifier diagnostics in getSuggestionDiagnostics (it is basically redoing the checkUnusedIdentifiers call in checkSourceFile does, but reclassifying them as suggestions).

@DanielRosenwasser DanielRosenwasser merged commit 6aba9b8 into main Feb 13, 2023
@DanielRosenwasser DanielRosenwasser deleted the dropDeferredNodesPostCheck branch February 13, 2023 21:50
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.

3 participants