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

Remove sys.bufferFrom, duplicate Buffer declarations, etc #57916

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

jakebailey
Copy link
Member

Direct use of Buffer was added in #22658 for base64. Later, #25659 added bufferFrom to work around a bug in Node v5. #29813 added a duplicate declaration of Buffer to get the project to compile properly.

These days, none of this appears to be needed. We can just use the global Buffer directly and drop all of the duplicate declarations and wrapping.

BufferEncoding unfortunately remains due to its use in the tsserver Session interface.

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

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 23, 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,465k (± 0.01%) 295,472k (± 0.01%) ~ 295,438k 295,516k p=0.688 n=6
Parse Time 3.21s (± 0.46%) 3.19s (± 1.09%) ~ 3.15s 3.24s p=0.256 n=6
Bind Time 0.99s (± 0.82%) 0.99s (± 0.76%) ~ 0.98s 1.00s p=0.729 n=6
Check Time 9.62s (± 0.36%) 9.61s (± 0.33%) ~ 9.57s 9.64s p=0.512 n=6
Emit Time 8.38s (± 0.18%) 8.38s (± 0.35%) ~ 8.36s 8.44s p=0.465 n=6
Total Time 22.21s (± 0.16%) 22.17s (± 0.28%) ~ 22.09s 22.26s p=0.295 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 193,809k (± 1.07%) 193,633k (± 1.00%) ~ 191,800k 195,488k p=0.298 n=6
Parse Time 1.64s (± 1.07%) 1.66s (± 0.83%) ~ 1.64s 1.68s p=0.104 n=6
Bind Time 0.86s (± 0.00%) 0.86s (± 0.94%) ~ 0.85s 0.87s p=0.290 n=6
Check Time 11.27s (± 0.70%) 11.26s (± 1.00%) ~ 11.09s 11.37s p=1.000 n=6
Emit Time 3.16s (± 0.76%) 3.15s (± 0.44%) ~ 3.13s 3.17s p=0.318 n=6
Total Time 16.93s (± 0.43%) 16.93s (± 0.60%) ~ 16.80s 17.04s p=1.000 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,405k (± 0.00%) 347,391k (± 0.00%) ~ 347,369k 347,401k p=0.199 n=6
Parse Time 2.99s (± 1.68%) 2.98s (± 0.59%) ~ 2.97s 3.01s p=0.935 n=6
Bind Time 1.11s (± 0.80%) 1.11s (± 0.37%) ~ 1.10s 1.11s p=0.787 n=6
Check Time 8.27s (± 0.42%) 8.26s (± 0.35%) ~ 8.21s 8.29s p=1.000 n=6
Emit Time 4.86s (± 0.68%) 4.86s (± 0.33%) ~ 4.85s 4.89s p=0.871 n=6
Total Time 17.22s (± 0.37%) 17.21s (± 0.11%) ~ 17.20s 17.25s p=0.570 n=6
TFS - node (v18.15.0, x64)
Memory used 302,700k (± 0.01%) 302,706k (± 0.00%) ~ 302,686k 302,727k p=0.747 n=6
Parse Time 2.41s (± 0.48%) 2.42s (± 0.50%) ~ 2.41s 2.44s p=0.099 n=6
Bind Time 1.19s (± 0.70%) 1.23s (± 0.51%) +0.04s (+ 2.93%) 1.22s 1.24s p=0.004 n=6
Check Time 7.47s (± 0.39%) 7.45s (± 0.32%) ~ 7.42s 7.48s p=0.227 n=6
Emit Time 4.27s (± 0.64%) 4.29s (± 0.65%) ~ 4.25s 4.32s p=0.216 n=6
Total Time 15.35s (± 0.20%) 15.39s (± 0.14%) +0.04s (+ 0.29%) 15.37s 15.42s p=0.024 n=6
material-ui - node (v18.15.0, x64)
Memory used 509,925k (± 0.01%) 509,922k (± 0.00%) ~ 509,896k 509,937k p=0.936 n=6
Parse Time 3.93s (± 0.28%) 3.92s (± 0.21%) ~ 3.91s 3.93s p=0.383 n=6
Bind Time 1.44s (± 1.50%) 1.45s (± 0.72%) ~ 1.44s 1.47s p=0.343 n=6
Check Time 25.39s (± 0.22%) 25.31s (± 0.23%) ~ 25.24s 25.40s p=0.054 n=6
Emit Time 0.00s (±244.70%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=0.405 n=6
Total Time 30.76s (± 0.24%) 30.69s (± 0.17%) ~ 30.62s 30.75s p=0.109 n=6
mui-docs - node (v18.15.0, x64)
Memory used 1,737,550k (± 0.00%) 1,737,555k (± 0.00%) ~ 1,737,512k 1,737,597k p=1.000 n=6
Parse Time 7.76s (± 0.41%) 7.79s (± 0.64%) ~ 7.74s 7.88s p=0.466 n=6
Bind Time 2.79s (± 0.29%) 2.79s (± 0.55%) ~ 2.76s 2.80s p=1.000 n=6
Check Time 66.55s (± 0.34%) 66.63s (± 0.35%) ~ 66.20s 66.85s p=0.689 n=6
Emit Time 0.15s (± 3.53%) 0.15s (± 3.53%) ~ 0.15s 0.16s p=1.000 n=6
Total Time 77.26s (± 0.30%) 77.36s (± 0.35%) ~ 76.86s 77.63s p=0.471 n=6
self-build-src - node (v18.15.0, x64)
Memory used 2,393,636k (± 0.02%) 2,389,539k (± 0.04%) -4,097k (- 0.17%) 2,387,932k 2,390,587k p=0.005 n=6
Parse Time 6.06s (± 0.56%) 6.03s (± 0.74%) ~ 5.96s 6.10s p=0.297 n=6
Bind Time 2.24s (± 1.46%) 2.26s (± 0.54%) ~ 2.25s 2.28s p=0.360 n=6
Check Time 39.36s (± 0.32%) 39.32s (± 0.31%) ~ 39.21s 39.47s p=0.748 n=6
Emit Time 3.11s (± 1.06%) 3.16s (± 1.71%) ~ 3.10s 3.25s p=0.092 n=6
Total Time 50.79s (± 0.27%) 50.79s (± 0.31%) ~ 50.63s 51.04s p=0.873 n=6
self-compiler - node (v18.15.0, x64)
Memory used 415,096k (± 0.01%) 414,553k (± 0.01%) -544k (- 0.13%) 414,506k 414,587k p=0.005 n=6
Parse Time 3.41s (± 0.64%) 3.39s (± 0.78%) ~ 3.35s 3.42s p=0.225 n=6
Bind Time 1.29s (± 1.03%) 1.30s (± 0.80%) ~ 1.28s 1.31s p=0.553 n=6
Check Time 18.04s (± 0.23%) 18.02s (± 0.29%) ~ 17.95s 18.10s p=0.521 n=6
Emit Time 1.32s (± 1.76%) 1.36s (± 1.29%) +0.05s (+ 3.54%) 1.34s 1.38s p=0.015 n=6
Total Time 24.06s (± 0.29%) 24.07s (± 0.23%) ~ 24.00s 24.14s p=0.873 n=6
vscode - node (v18.15.0, x64)
Memory used 2,891,003k (± 0.00%) 2,891,012k (± 0.00%) ~ 2,890,994k 2,891,025k p=0.336 n=6
Parse Time 12.94s (± 0.34%) 12.94s (± 0.33%) ~ 12.89s 13.00s p=0.872 n=6
Bind Time 4.12s (± 0.20%) 4.15s (± 1.22%) ~ 4.11s 4.25s p=0.190 n=6
Check Time 71.58s (± 0.61%) 71.47s (± 0.24%) ~ 71.24s 71.70s p=1.000 n=6
Emit Time 19.50s (± 0.77%) 19.40s (± 0.66%) ~ 19.26s 19.54s p=0.688 n=6
Total Time 108.15s (± 0.37%) 107.96s (± 0.17%) ~ 107.74s 108.18s p=0.423 n=6
webpack - node (v18.15.0, x64)
Memory used 408,140k (± 0.01%) 408,143k (± 0.01%) ~ 408,073k 408,191k p=0.873 n=6
Parse Time 3.90s (± 0.98%) 3.93s (± 0.55%) ~ 3.89s 3.94s p=0.327 n=6
Bind Time 1.68s (± 0.97%) 1.68s (± 0.75%) ~ 1.66s 1.69s p=0.681 n=6
Check Time 16.75s (± 0.41%) 16.74s (± 0.47%) ~ 16.61s 16.81s p=1.000 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.34s (± 0.40%) 22.35s (± 0.38%) ~ 22.24s 22.43s p=1.000 n=6
xstate - node (v18.15.0, x64)
Memory used 513,030k (± 0.02%) 513,070k (± 0.01%) ~ 512,997k 513,150k p=0.471 n=6
Parse Time 3.95s (± 0.44%) 3.96s (± 0.89%) ~ 3.91s 4.00s p=0.807 n=6
Bind Time 1.86s (± 0.99%) 1.85s (± 1.06%) ~ 1.84s 1.88s p=0.806 n=6
Check Time 3.39s (± 0.94%) 3.38s (± 0.44%) ~ 3.37s 3.40s p=1.000 n=6
Emit Time 0.09s (± 6.44%) 0.09s (± 5.95%) ~ 0.08s 0.09s p=0.640 n=6
Total Time 9.28s (± 0.61%) 9.29s (± 0.52%) ~ 9.21s 9.33s 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,376ms (± 0.69%) 2,368ms (± 1.07%) ~ 2,329ms 2,397ms p=0.936 n=6
Req 2 - geterr 5,592ms (± 0.66%) 5,639ms (± 1.60%) ~ 5,553ms 5,806ms p=0.471 n=6
Req 3 - references 319ms (± 0.80%) 318ms (± 0.40%) ~ 316ms 320ms p=0.924 n=6
Req 4 - navto 273ms (± 0.00%) 273ms (± 0.65%) ~ 269ms 274ms p=1.000 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 87ms (± 0.60%) 89ms (± 4.72%) ~ 86ms 97ms p=0.386 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,495ms (± 0.90%) 2,508ms (± 1.11%) ~ 2,468ms 2,536ms p=0.575 n=6
Req 2 - geterr 4,114ms (± 0.18%) 4,117ms (± 0.32%) ~ 4,102ms 4,136ms p=0.873 n=6
Req 3 - references 333ms (± 0.15%) 332ms (± 0.66%) ~ 328ms 334ms p=0.242 n=6
Req 4 - navto 295ms (± 0.21%) 295ms (± 0.40%) ~ 293ms 296ms p=1.000 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 73ms (± 0.70%) 74ms (± 0.70%) ~ 73ms 74ms p=0.311 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,608ms (± 0.44%) 2,607ms (± 0.20%) ~ 2,601ms 2,615ms p=0.423 n=6
Req 2 - geterr 1,738ms (± 2.17%) 1,715ms (± 2.35%) ~ 1,667ms 1,782ms p=0.298 n=6
Req 3 - references 124ms (± 0.94%) 119ms (± 8.74%) ~ 104ms 129ms p=0.625 n=6
Req 4 - navto 367ms (± 1.10%) 369ms (± 0.93%) ~ 363ms 373ms p=0.517 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 310ms (± 1.82%) 311ms (± 1.73%) ~ 304ms 317ms p=0.871 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.28ms (± 0.17%) 153.16ms (± 0.16%) -0.12ms (- 0.08%) 152.12ms 155.32ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 226.16ms (± 0.15%) 226.02ms (± 0.17%) -0.14ms (- 0.06%) 224.41ms 232.67ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 221.82ms (± 0.15%) 221.79ms (± 0.17%) ~ 220.27ms 227.19ms p=0.374 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 221.13ms (± 0.17%) 221.10ms (± 0.18%) ~ 219.64ms 226.20ms p=0.514 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 jakebailey merged commit 3c0a802 into microsoft:main Mar 25, 2024
25 checks passed
@jakebailey jakebailey deleted the no-buffer branch March 25, 2024 17: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