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

Don't indirect through _namespaces in tsserver/typingsInstaller #57829

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Mar 18, 2024

A follow-up to #55326 which directly pulls from the public API project rather than indirecting through _namespaces, which incurs an extra copy due to esbuild's helpers.

I expect the bundle size to get larger due to the name esbuild chooses for the module, but potentially faster to load as it's not recreating a public API object.

This also likely locks off using named imports for nested modules as asked about in #55326 (review), but I have not found a way to do those within our current import syntax.

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

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 18, 2024

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

Command Status Results
perf test this ✅ Started 👀 Results

@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,704k (± 0.01%) 295,717k (± 0.00%) ~ 295,706k 295,738k p=0.423 n=6
Parse Time 2.66s (± 0.19%) 2.66s (± 0.31%) ~ 2.64s 2.66s p=0.114 n=6
Bind Time 0.83s (± 0.49%) 0.83s (± 0.49%) ~ 0.82s 0.83s p=1.000 n=6
Check Time 8.21s (± 0.44%) 8.22s (± 0.33%) ~ 8.19s 8.27s p=0.624 n=6
Emit Time 7.15s (± 0.23%) 7.16s (± 0.36%) ~ 7.11s 7.18s p=0.406 n=6
Total Time 18.85s (± 0.19%) 18.86s (± 0.14%) ~ 18.82s 18.89s p=0.566 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 193,185k (± 0.90%) 192,006k (± 0.10%) ~ 191,883k 192,410k p=0.298 n=6
Parse Time 1.37s (± 0.89%) 1.35s (± 1.15%) ~ 1.33s 1.36s p=0.103 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 0.00%) ~ 0.72s 0.72s p=1.000 n=6
Check Time 9.52s (± 0.60%) 9.55s (± 0.55%) ~ 9.49s 9.63s p=0.334 n=6
Emit Time 2.65s (± 0.24%) 2.65s (± 0.67%) ~ 2.63s 2.67s p=1.000 n=6
Total Time 14.26s (± 0.37%) 14.28s (± 0.37%) ~ 14.22s 14.36s p=0.571 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,367k (± 0.01%) 347,360k (± 0.00%) ~ 347,341k 347,373k p=0.873 n=6
Parse Time 2.49s (± 0.60%) 2.48s (± 0.30%) ~ 2.47s 2.49s p=0.187 n=6
Bind Time 0.93s (± 0.56%) 0.92s (± 0.88%) ~ 0.91s 0.93s p=0.523 n=6
Check Time 7.03s (± 0.38%) 7.03s (± 0.51%) ~ 6.99s 7.08s p=0.746 n=6
Emit Time 4.07s (± 0.48%) 4.06s (± 0.76%) ~ 4.02s 4.10s p=0.808 n=6
Total Time 14.51s (± 0.17%) 14.49s (± 0.25%) ~ 14.44s 14.54s p=0.329 n=6
TFS - node (v18.15.0, x64)
Memory used 302,739k (± 0.01%) 302,737k (± 0.00%) ~ 302,711k 302,751k p=0.520 n=6
Parse Time 2.01s (± 0.87%) 2.01s (± 1.29%) ~ 1.98s 2.05s p=0.418 n=6
Bind Time 1.00s (± 0.75%) 1.01s (± 1.25%) ~ 0.99s 1.02s p=0.115 n=6
Check Time 6.31s (± 0.44%) 6.30s (± 0.49%) ~ 6.26s 6.35s p=0.683 n=6
Emit Time 3.61s (± 0.42%) 3.61s (± 0.25%) ~ 3.60s 3.62s p=0.801 n=6
Total Time 12.94s (± 0.22%) 12.93s (± 0.19%) ~ 12.90s 12.96s p=0.743 n=6
material-ui - node (v18.15.0, x64)
Memory used 511,371k (± 0.00%) 511,379k (± 0.01%) ~ 511,357k 511,419k p=0.575 n=6
Parse Time 2.65s (± 0.46%) 2.66s (± 0.73%) ~ 2.63s 2.69s p=0.390 n=6
Bind Time 0.98s (± 1.63%) 0.99s (± 0.52%) ~ 0.98s 0.99s p=0.923 n=6
Check Time 17.32s (± 0.45%) 17.39s (± 0.37%) ~ 17.30s 17.49s p=0.092 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.95s (± 0.35%) 21.04s (± 0.24%) +0.08s (+ 0.40%) 20.98s 21.13s p=0.045 n=6
mui-docs - node (v18.15.0, x64)
Memory used 1,798,670k (± 0.00%) 1,798,709k (± 0.00%) ~ 1,798,681k 1,798,753k p=0.128 n=6
Parse Time 6.61s (± 0.30%) 6.63s (± 0.61%) ~ 6.60s 6.71s p=0.418 n=6
Bind Time 2.39s (± 0.53%) 2.39s (± 0.31%) ~ 2.38s 2.40s p=0.676 n=6
Check Time 59.41s (± 0.85%) 59.21s (± 0.52%) ~ 58.72s 59.56s p=0.689 n=6
Emit Time 0.16s (± 3.16%) 0.16s (± 3.16%) ~ 0.16s 0.17s p=1.000 n=6
Total Time 68.57s (± 0.76%) 68.40s (± 0.41%) ~ 67.99s 68.73s p=0.689 n=6
self-build-src - node (v18.15.0, x64)
Memory used 2,397,262k (± 0.04%) 2,397,092k (± 0.01%) ~ 2,396,598k 2,397,473k p=0.378 n=6
Parse Time 5.01s (± 1.14%) 5.01s (± 0.45%) ~ 4.97s 5.03s p=0.936 n=6
Bind Time 1.91s (± 0.66%) 1.91s (± 0.86%) ~ 1.89s 1.93s p=0.681 n=6
Check Time 33.52s (± 0.45%) 33.43s (± 0.31%) ~ 33.26s 33.57s p=0.230 n=6
Emit Time 2.75s (± 1.58%) 2.74s (± 1.42%) ~ 2.67s 2.77s p=0.575 n=6
Total Time 43.20s (± 0.42%) 43.11s (± 0.35%) ~ 42.85s 43.24s p=0.575 n=6
self-compiler - node (v18.15.0, x64)
Memory used 415,480k (± 0.01%) 415,477k (± 0.01%) ~ 415,418k 415,527k p=0.689 n=6
Parse Time 2.82s (± 0.82%) 2.81s (± 0.73%) ~ 2.78s 2.84s p=0.567 n=6
Bind Time 1.07s (± 0.70%) 1.08s (± 0.48%) ~ 1.07s 1.08s p=0.247 n=6
Check Time 15.34s (± 0.45%) 15.33s (± 0.24%) ~ 15.29s 15.39s p=1.000 n=6
Emit Time 1.15s (± 0.65%) 1.15s (± 0.90%) ~ 1.14s 1.16s p=0.664 n=6
Total Time 20.38s (± 0.39%) 20.36s (± 0.23%) ~ 20.30s 20.41s p=1.000 n=6
vscode - node (v18.15.0, x64)
Memory used 2,882,549k (± 0.00%) 2,882,556k (± 0.00%) ~ 2,882,516k 2,882,622k p=0.575 n=6
Parse Time 10.79s (± 0.18%) 10.83s (± 0.21%) +0.04s (+ 0.36%) 10.80s 10.86s p=0.023 n=6
Bind Time 3.45s (± 0.38%) 3.46s (± 0.35%) ~ 3.44s 3.47s p=0.615 n=6
Check Time 61.60s (± 0.53%) 61.41s (± 0.24%) ~ 61.17s 61.56s p=0.199 n=6
Emit Time 16.95s (± 7.86%) 16.38s (± 0.56%) ~ 16.26s 16.49s p=0.521 n=6
Total Time 92.80s (± 1.69%) 92.08s (± 0.15%) ~ 91.94s 92.27s p=0.228 n=6
webpack - node (v18.15.0, x64)
Memory used 406,474k (± 0.02%) 406,506k (± 0.01%) ~ 406,431k 406,584k p=0.261 n=6
Parse Time 3.20s (± 0.72%) 3.24s (± 0.41%) +0.04s (+ 1.25%) 3.22s 3.26s p=0.010 n=6
Bind Time 1.38s (± 0.75%) 1.38s (± 0.30%) ~ 1.38s 1.39s p=0.545 n=6
Check Time 14.25s (± 0.23%) 14.24s (± 0.43%) ~ 14.16s 14.31s p=0.570 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 18.83s (± 0.21%) 18.86s (± 0.35%) ~ 18.79s 18.94s p=0.687 n=6
xstate - node (v18.15.0, x64)
Memory used 513,270k (± 0.01%) 513,303k (± 0.02%) ~ 513,213k 513,470k p=0.630 n=6
Parse Time 3.28s (± 0.30%) 3.28s (± 0.23%) ~ 3.27s 3.29s p=0.652 n=6
Bind Time 1.55s (± 0.49%) 1.54s (± 0.26%) ~ 1.54s 1.55s p=0.100 n=6
Check Time 2.85s (± 0.47%) 2.86s (± 0.60%) ~ 2.84s 2.89s p=0.317 n=6
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) ~ 0.07s 0.07s p=1.000 n=6
Total Time 7.75s (± 0.13%) 7.75s (± 0.20%) ~ 7.74s 7.78s p=1.000 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,346ms (± 0.60%) 2,364ms (± 0.60%) +19ms (+ 0.79%) 2,336ms 2,374ms p=0.020 n=6
Req 2 - geterr 5,781ms (± 0.41%) 5,632ms (± 1.62%) -149ms (- 2.57%) 5,570ms 5,812ms p=0.045 n=6
Req 3 - references 327ms (± 1.20%) 322ms (± 1.18%) ~ 319ms 328ms p=0.063 n=6
Req 4 - navto 273ms (± 0.36%) 277ms (± 0.00%) +4ms (+ 1.40%) 277ms 277ms p=0.002 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 92ms (± 7.10%) 84ms (± 0.48%) ~ 84ms 85ms p=0.054 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,487ms (± 1.20%) 2,488ms (± 0.86%) ~ 2,469ms 2,522ms p=0.810 n=6
Req 2 - geterr 4,265ms (± 0.21%) 4,117ms (± 0.20%) 🟩-147ms (- 3.45%) 4,108ms 4,126ms p=0.005 n=6
Req 3 - references 332ms (± 0.27%) 333ms (± 0.58%) ~ 329ms 334ms p=0.117 n=6
Req 4 - navto 284ms (± 0.47%) 286ms (± 0.14%) +2ms (+ 0.70%) 286ms 287ms p=0.010 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 78ms (± 0.81%) 73ms (± 0.70%) 🟩-5ms (- 5.98%) 73ms 74ms p=0.004 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,620ms (± 0.15%) 2,624ms (± 0.42%) ~ 2,609ms 2,641ms p=0.423 n=6
Req 2 - geterr 1,711ms (± 2.61%) 1,741ms (± 2.28%) ~ 1,692ms 1,777ms p=0.261 n=6
Req 3 - references 126ms (± 3.59%) 119ms (± 9.38%) ~ 108ms 130ms p=0.683 n=6
Req 4 - navto 373ms (± 1.52%) 372ms (± 1.04%) ~ 364ms 375ms p=0.744 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 305ms (± 1.41%) 303ms (± 1.96%) ~ 294ms 310ms p=0.295 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.98ms (± 0.15%) 153.87ms (± 0.17%) -0.11ms (- 0.07%) 152.63ms 156.71ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 228.59ms (± 0.18%) 226.40ms (± 0.15%) -2.19ms (- 0.96%) 225.13ms 230.54ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 222.10ms (± 0.15%) 222.00ms (± 0.17%) -0.09ms (- 0.04%) 220.66ms 229.16ms p=0.001 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 222.83ms (± 0.18%) 223.02ms (± 0.16%) +0.19ms (+ 0.09%) 221.37ms 228.48ms 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

@jakebailey
Copy link
Member Author

Like 1% on tsserver, not exactly amazing.

@jakebailey
Copy link
Member Author

But, probably worth it to not have _namespaces anymore.

@jakebailey jakebailey marked this pull request as ready for review March 19, 2024 16:07
@jakebailey jakebailey merged commit dc113f8 into microsoft:main Mar 20, 2024
26 checks passed
@jakebailey jakebailey deleted the new-bundle-cleanup branch March 20, 2024 23:41
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