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

Skip visits to child nodes of entity names in visitExistingNodeTreeSymbols #58067

Merged
merged 2 commits into from
Apr 4, 2024

Conversation

weswigham
Copy link
Member

This just skips visiting some children of entity names where we'd just repeat the same symbol resolution repeatedly (if we lookup A in A.B, we don't need to also visit A and B, so long as we attach symbol info for A during that first lookup), or would never actually resolve (because it's the name of the declaration).

I'm not sure if this'd actually show up on any perf tests (but it should definitely be good for perf - we're just doing less repeated work), but what it does do is make any future users of trackSymbol (eg, isolatedDeclarations resolver/checker) need to handle fewer cases.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Apr 3, 2024
@weswigham
Copy link
Member Author

weswigham commented Apr 3, 2024

@typescript-bot perf test this though I doubt this'll register, since it'll probably only affect the time it takes to issue some overcomplicated errors?

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 3, 2024

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

Command Status Results
perf test this though I doubt this'll register, since it'll probably only affect the time it takes to issue some overcomplicated errors? ❌ Error: Error: The 'TSPERF_PRESET' parameter value 'though' is not a valid value.

@jakebailey
Copy link
Member

Oh yeah you can't just stick random garbage onto the bot commands, they're passed through (I intend to have arguments to perf testing in the near future).

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 3, 2024

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

Command Status Results
perf test this ✅ Started 👀 Results

@weswigham
Copy link
Member Author

@typescript-bot perf test this
note to self: make it not fail if the next word isn't "faster"

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 3, 2024

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

Command Status Results
perf test this ✅ Started

@typescript-bot
Copy link
Collaborator

@jakebailey
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
Angular - node (v18.15.0, x64)
Memory used 295,651k (± 0.02%) 295,649k (± 0.02%) ~ 295,584k 295,713k p=0.936 n=6
Parse Time 3.92s (± 0.25%) 3.94s (± 0.27%) ~ 3.92s 3.95s p=0.066 n=6
Bind Time 1.22s (± 1.24%) 1.23s (± 1.33%) ~ 1.21s 1.25s p=1.000 n=6
Check Time 12.04s (± 0.21%) 12.04s (± 0.35%) ~ 12.00s 12.12s p=1.000 n=6
Emit Time 10.46s (± 0.20%) 10.49s (± 0.31%) ~ 10.44s 10.54s p=0.086 n=6
Total Time 27.64s (± 0.12%) 27.69s (± 0.10%) +0.05s (+ 0.19%) 27.65s 27.72s p=0.029 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 193,324k (± 0.98%) 193,275k (± 0.95%) ~ 192,015k 195,685k p=0.936 n=6
Parse Time 2.03s (± 1.58%) 2.01s (± 0.86%) ~ 1.99s 2.03s p=0.134 n=6
Bind Time 1.08s (± 0.91%) 1.08s (± 1.08%) ~ 1.06s 1.09s p=1.000 n=6
Check Time 13.96s (± 0.42%) 13.95s (± 0.68%) ~ 13.85s 14.11s p=0.628 n=6
Emit Time 3.87s (± 0.43%) 3.88s (± 0.51%) ~ 3.84s 3.89s p=0.411 n=6
Total Time 20.94s (± 0.33%) 20.92s (± 0.43%) ~ 20.82s 21.06s p=0.470 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,449k (± 0.01%) 347,442k (± 0.00%) ~ 347,422k 347,460k p=0.575 n=6
Parse Time 3.69s (± 1.02%) 3.72s (± 0.63%) ~ 3.70s 3.76s p=0.090 n=6
Bind Time 1.37s (± 0.55%) 1.38s (± 1.10%) ~ 1.36s 1.40s p=0.503 n=6
Check Time 10.19s (± 0.24%) 10.18s (± 0.34%) ~ 10.13s 10.22s p=0.872 n=6
Emit Time 6.02s (± 0.35%) 6.03s (± 0.12%) ~ 6.02s 6.04s p=0.453 n=6
Total Time 21.27s (± 0.20%) 21.31s (± 0.20%) ~ 21.27s 21.39s p=0.257 n=6
TFS - node (v18.15.0, x64)
Memory used 302,833k (± 0.00%) 302,833k (± 0.01%) ~ 302,786k 302,860k p=1.000 n=6
Parse Time 2.01s (± 0.68%) 2.01s (± 0.75%) ~ 2.00s 2.04s p=0.869 n=6
Bind Time 1.00s (± 0.41%) 1.00s (± 0.51%) ~ 1.00s 1.01s p=0.114 n=6
Check Time 6.41s (± 0.51%) 6.40s (± 0.34%) ~ 6.36s 6.42s p=0.569 n=6
Emit Time 3.59s (± 0.58%) 3.58s (± 0.29%) ~ 3.57s 3.60s p=1.000 n=6
Total Time 13.02s (± 0.44%) 13.00s (± 0.27%) ~ 12.94s 13.03s p=0.629 n=6
material-ui - node (v18.15.0, x64)
Memory used 510,111k (± 0.01%) 510,131k (± 0.01%) ~ 510,073k 510,250k p=0.689 n=6
Parse Time 3.19s (± 0.37%) 3.19s (± 0.44%) ~ 3.17s 3.21s p=0.934 n=6
Bind Time 1.19s (± 1.14%) 1.18s (± 0.64%) ~ 1.17s 1.19s p=0.081 n=6
Check Time 20.61s (± 0.36%) 20.55s (± 0.29%) ~ 20.44s 20.60s p=0.146 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 24.99s (± 0.35%) 24.92s (± 0.27%) ~ 24.79s 24.98s p=0.230 n=6
mui-docs - node (v18.15.0, x64)
Memory used 1,744,914k (± 0.00%) 1,744,891k (± 0.00%) ~ 1,744,872k 1,744,907k p=0.092 n=6
Parse Time 9.60s (± 0.42%) 9.63s (± 0.87%) ~ 9.53s 9.75s p=0.520 n=6
Bind Time 3.44s (± 0.48%) 3.48s (± 0.59%) +0.03s (+ 0.92%) 3.44s 3.50s p=0.035 n=6
Check Time 81.95s (± 0.38%) 81.73s (± 0.39%) ~ 81.23s 82.17s p=0.336 n=6
Emit Time 0.19s (± 2.13%) 0.19s (± 2.67%) ~ 0.19s 0.20s p=0.595 n=6
Total Time 95.18s (± 0.34%) 95.04s (± 0.41%) ~ 94.44s 95.61s p=0.471 n=6
self-build-src - node (v18.15.0, x64)
Memory used 2,400,145k (± 0.04%) 2,400,075k (± 0.03%) ~ 2,399,421k 2,401,077k p=0.689 n=6
Parse Time 5.00s (± 0.88%) 5.03s (± 1.53%) ~ 4.96s 5.14s p=0.630 n=6
Bind Time 1.92s (± 0.86%) 1.92s (± 0.98%) ~ 1.88s 1.93s p=1.000 n=6
Check Time 33.98s (± 0.29%) 33.93s (± 0.27%) ~ 33.83s 34.04s p=0.261 n=6
Emit Time 2.67s (± 1.15%) 2.68s (± 1.05%) ~ 2.64s 2.72s p=0.421 n=6
Total Time 43.57s (± 0.24%) 43.56s (± 0.33%) ~ 43.42s 43.79s p=0.936 n=6
self-compiler - node (v18.15.0, x64)
Memory used 416,345k (± 0.01%) 416,341k (± 0.01%) ~ 416,295k 416,393k p=0.936 n=6
Parse Time 3.34s (± 0.45%) 3.35s (± 0.99%) ~ 3.31s 3.40s p=0.870 n=6
Bind Time 1.29s (± 0.40%) 1.30s (± 0.64%) +0.01s (+ 0.90%) 1.29s 1.31s p=0.033 n=6
Check Time 18.23s (± 0.29%) 18.23s (± 0.33%) ~ 18.17s 18.33s p=0.936 n=6
Emit Time 1.33s (± 1.50%) 1.34s (± 1.60%) ~ 1.32s 1.37s p=0.516 n=6
Total Time 24.20s (± 0.26%) 24.21s (± 0.23%) ~ 24.15s 24.31s p=1.000 n=6
vscode - node (v18.15.0, x64)
Memory used 2,907,180k (± 0.00%) 2,907,132k (± 0.00%) ~ 2,907,030k 2,907,216k p=0.575 n=6
Parse Time 15.95s (± 0.64%) 15.92s (± 0.42%) ~ 15.86s 16.03s p=0.470 n=6
Bind Time 5.06s (± 0.55%) 5.08s (± 0.55%) ~ 5.06s 5.13s p=0.195 n=6
Check Time 87.85s (± 0.22%) 87.72s (± 0.68%) ~ 87.22s 88.75s p=0.630 n=6
Emit Time 23.78s (± 0.60%) 24.55s (± 7.30%) ~ 23.70s 28.21s p=0.336 n=6
Total Time 132.64s (± 0.26%) 133.28s (± 1.27%) ~ 131.94s 136.52s p=0.689 n=6
webpack - node (v18.15.0, x64)
Memory used 408,827k (± 0.02%) 408,863k (± 0.02%) ~ 408,786k 408,944k p=0.298 n=6
Parse Time 3.23s (± 0.34%) 3.23s (± 0.36%) ~ 3.22s 3.25s p=1.000 n=6
Bind Time 1.39s (± 1.53%) 1.41s (± 1.04%) ~ 1.39s 1.43s p=0.224 n=6
Check Time 14.31s (± 0.39%) 14.29s (± 0.32%) ~ 14.21s 14.34s p=0.521 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 18.93s (± 0.31%) 18.93s (± 0.20%) ~ 18.87s 18.97s p=0.688 n=6
xstate - node (v18.15.0, x64)
Memory used 513,516k (± 0.02%) 513,686k (± 0.01%) +170k (+ 0.03%) 513,627k 513,734k p=0.020 n=6
Parse Time 4.93s (± 0.82%) 4.89s (± 0.89%) ~ 4.84s 4.94s p=0.199 n=6
Bind Time 2.31s (± 0.47%) 2.31s (± 0.85%) ~ 2.28s 2.34s p=0.453 n=6
Check Time 4.33s (± 0.84%) 4.34s (± 0.39%) ~ 4.32s 4.36s p=0.566 n=6
Emit Time 0.11s (± 0.00%) 0.11s (± 0.00%) ~ 0.11s 0.11s p=1.000 n=6
Total Time 11.66s (± 0.55%) 11.64s (± 0.41%) ~ 11.57s 11.70s p=0.748 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)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - 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,992ms (± 9.17%) 2,871ms (± 1.02%) ~ 2,812ms 2,890ms p=0.748 n=6
Req 2 - geterr 7,183ms (± 9.76%) 6,942ms (± 7.08%) ~ 6,720ms 7,945ms p=0.810 n=6
Req 3 - references 409ms (± 8.10%) 434ms (±10.07%) ~ 383ms 473ms p=0.688 n=6
Req 4 - navto 382ms (± 9.78%) 406ms (± 0.51%) ~ 402ms 407ms p=0.557 n=6
Req 5 - completionInfo count 1,357 (± 0.00%) 1,357 (± 0.00%) ~ 1,357 1,357 p=1.000 n=6
Req 5 - completionInfo 128ms (± 9.53%) 130ms (± 0.69%) ~ 129ms 131ms p=0.934 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 3,704ms (± 1.01%) 3,734ms (± 0.80%) ~ 3,693ms 3,768ms p=0.148 n=6
Req 2 - geterr 6,117ms (± 0.37%) 6,112ms (± 0.34%) ~ 6,086ms 6,134ms p=1.000 n=6
Req 3 - references 494ms (± 0.38%) 494ms (± 0.28%) ~ 493ms 496ms p=0.680 n=6
Req 4 - navto 444ms (± 1.13%) 446ms (± 0.36%) ~ 443ms 447ms p=0.231 n=6
Req 5 - completionInfo count 1,519 (± 0.00%) 1,519 (± 0.00%) ~ 1,519 1,519 p=1.000 n=6
Req 5 - completionInfo 109ms (± 0.47%) 109ms (± 0.77%) ~ 107ms 109ms p=0.070 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 3,668ms (±10.06%) 3,251ms (± 6.96%) 🟩-416ms (-11.35%) 3,143ms 3,713ms p=0.013 n=6
Req 2 - geterr 2,437ms (± 0.92%) 2,156ms (±10.48%) ~ 1,996ms 2,456ms p=0.093 n=6
Req 3 - references 148ms (± 1.35%) 150ms (± 1.81%) ~ 146ms 153ms p=0.187 n=6
Req 4 - navto 560ms (± 1.60%) 566ms (± 2.31%) ~ 557ms 589ms p=0.127 n=6
Req 5 - completionInfo count 2,079 (± 0.00%) 2,079 (± 0.00%) ~ 2,079 2,079 p=1.000 n=6
Req 5 - completionInfo 451ms (± 1.84%) 455ms (± 0.82%) ~ 452ms 461ms p=0.296 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.89ms (± 0.17%) 153.71ms (± 0.16%) -0.18ms (- 0.12%) 152.70ms 156.61ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 227.95ms (± 0.16%) 228.00ms (± 0.17%) ~ 226.39ms 232.66ms p=0.285 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 222.69ms (± 0.18%) 222.64ms (± 0.18%) ~ 221.12ms 228.15ms p=0.243 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 328.70ms (± 0.30%) 328.65ms (± 0.28%) ~ 321.19ms 332.60ms p=0.977 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

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

Seems fine, though it's a shame there's not really a testable thing here...

@weswigham weswigham merged commit 83e3d6a into microsoft:main Apr 4, 2024
25 checks passed
@weswigham weswigham deleted the skip-non-required-visit branch April 4, 2024 16:40
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