Skip to content

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

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:no-buffer
Mar 25, 2024
Merged

Remove sys.bufferFrom, duplicate Buffer declarations, etc#57916
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:no-buffer

Conversation

@jakebailey

Copy link
Copy Markdown
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.

@jakebailey

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Mar 23, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test this✅ Started👀 Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Angular - node (v18.15.0, x64)
Memory used295,465k (± 0.01%)295,472k (± 0.01%)~295,438k295,516kp=0.688 n=6
Parse Time3.21s (± 0.46%)3.19s (± 1.09%)~3.15s3.24sp=0.256 n=6
Bind Time0.99s (± 0.82%)0.99s (± 0.76%)~0.98s1.00sp=0.729 n=6
Check Time9.62s (± 0.36%)9.61s (± 0.33%)~9.57s9.64sp=0.512 n=6
Emit Time8.38s (± 0.18%)8.38s (± 0.35%)~8.36s8.44sp=0.465 n=6
Total Time22.21s (± 0.16%)22.17s (± 0.28%)~22.09s22.26sp=0.295 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used193,809k (± 1.07%)193,633k (± 1.00%)~191,800k195,488kp=0.298 n=6
Parse Time1.64s (± 1.07%)1.66s (± 0.83%)~1.64s1.68sp=0.104 n=6
Bind Time0.86s (± 0.00%)0.86s (± 0.94%)~0.85s0.87sp=0.290 n=6
Check Time11.27s (± 0.70%)11.26s (± 1.00%)~11.09s11.37sp=1.000 n=6
Emit Time3.16s (± 0.76%)3.15s (± 0.44%)~3.13s3.17sp=0.318 n=6
Total Time16.93s (± 0.43%)16.93s (± 0.60%)~16.80s17.04sp=1.000 n=6
Monaco - node (v18.15.0, x64)
Memory used347,405k (± 0.00%)347,391k (± 0.00%)~347,369k347,401kp=0.199 n=6
Parse Time2.99s (± 1.68%)2.98s (± 0.59%)~2.97s3.01sp=0.935 n=6
Bind Time1.11s (± 0.80%)1.11s (± 0.37%)~1.10s1.11sp=0.787 n=6
Check Time8.27s (± 0.42%)8.26s (± 0.35%)~8.21s8.29sp=1.000 n=6
Emit Time4.86s (± 0.68%)4.86s (± 0.33%)~4.85s4.89sp=0.871 n=6
Total Time17.22s (± 0.37%)17.21s (± 0.11%)~17.20s17.25sp=0.570 n=6
TFS - node (v18.15.0, x64)
Memory used302,700k (± 0.01%)302,706k (± 0.00%)~302,686k302,727kp=0.747 n=6
Parse Time2.41s (± 0.48%)2.42s (± 0.50%)~2.41s2.44sp=0.099 n=6
Bind Time1.19s (± 0.70%)1.23s (± 0.51%)+0.04s (+ 2.93%)1.22s1.24sp=0.004 n=6
Check Time7.47s (± 0.39%)7.45s (± 0.32%)~7.42s7.48sp=0.227 n=6
Emit Time4.27s (± 0.64%)4.29s (± 0.65%)~4.25s4.32sp=0.216 n=6
Total Time15.35s (± 0.20%)15.39s (± 0.14%)+0.04s (+ 0.29%)15.37s15.42sp=0.024 n=6
material-ui - node (v18.15.0, x64)
Memory used509,925k (± 0.01%)509,922k (± 0.00%)~509,896k509,937kp=0.936 n=6
Parse Time3.93s (± 0.28%)3.92s (± 0.21%)~3.91s3.93sp=0.383 n=6
Bind Time1.44s (± 1.50%)1.45s (± 0.72%)~1.44s1.47sp=0.343 n=6
Check Time25.39s (± 0.22%)25.31s (± 0.23%)~25.24s25.40sp=0.054 n=6
Emit Time0.00s (±244.70%)0.00s (± 0.00%)~0.00s0.00sp=0.405 n=6
Total Time30.76s (± 0.24%)30.69s (± 0.17%)~30.62s30.75sp=0.109 n=6
mui-docs - node (v18.15.0, x64)
Memory used1,737,550k (± 0.00%)1,737,555k (± 0.00%)~1,737,512k1,737,597kp=1.000 n=6
Parse Time7.76s (± 0.41%)7.79s (± 0.64%)~7.74s7.88sp=0.466 n=6
Bind Time2.79s (± 0.29%)2.79s (± 0.55%)~2.76s2.80sp=1.000 n=6
Check Time66.55s (± 0.34%)66.63s (± 0.35%)~66.20s66.85sp=0.689 n=6
Emit Time0.15s (± 3.53%)0.15s (± 3.53%)~0.15s0.16sp=1.000 n=6
Total Time77.26s (± 0.30%)77.36s (± 0.35%)~76.86s77.63sp=0.471 n=6
self-build-src - node (v18.15.0, x64)
Memory used2,393,636k (± 0.02%)2,389,539k (± 0.04%)-4,097k (- 0.17%)2,387,932k2,390,587kp=0.005 n=6
Parse Time6.06s (± 0.56%)6.03s (± 0.74%)~5.96s6.10sp=0.297 n=6
Bind Time2.24s (± 1.46%)2.26s (± 0.54%)~2.25s2.28sp=0.360 n=6
Check Time39.36s (± 0.32%)39.32s (± 0.31%)~39.21s39.47sp=0.748 n=6
Emit Time3.11s (± 1.06%)3.16s (± 1.71%)~3.10s3.25sp=0.092 n=6
Total Time50.79s (± 0.27%)50.79s (± 0.31%)~50.63s51.04sp=0.873 n=6
self-compiler - node (v18.15.0, x64)
Memory used415,096k (± 0.01%)414,553k (± 0.01%)-544k (- 0.13%)414,506k414,587kp=0.005 n=6
Parse Time3.41s (± 0.64%)3.39s (± 0.78%)~3.35s3.42sp=0.225 n=6
Bind Time1.29s (± 1.03%)1.30s (± 0.80%)~1.28s1.31sp=0.553 n=6
Check Time18.04s (± 0.23%)18.02s (± 0.29%)~17.95s18.10sp=0.521 n=6
Emit Time1.32s (± 1.76%)1.36s (± 1.29%)+0.05s (+ 3.54%)1.34s1.38sp=0.015 n=6
Total Time24.06s (± 0.29%)24.07s (± 0.23%)~24.00s24.14sp=0.873 n=6
vscode - node (v18.15.0, x64)
Memory used2,891,003k (± 0.00%)2,891,012k (± 0.00%)~2,890,994k2,891,025kp=0.336 n=6
Parse Time12.94s (± 0.34%)12.94s (± 0.33%)~12.89s13.00sp=0.872 n=6
Bind Time4.12s (± 0.20%)4.15s (± 1.22%)~4.11s4.25sp=0.190 n=6
Check Time71.58s (± 0.61%)71.47s (± 0.24%)~71.24s71.70sp=1.000 n=6
Emit Time19.50s (± 0.77%)19.40s (± 0.66%)~19.26s19.54sp=0.688 n=6
Total Time108.15s (± 0.37%)107.96s (± 0.17%)~107.74s108.18sp=0.423 n=6
webpack - node (v18.15.0, x64)
Memory used408,140k (± 0.01%)408,143k (± 0.01%)~408,073k408,191kp=0.873 n=6
Parse Time3.90s (± 0.98%)3.93s (± 0.55%)~3.89s3.94sp=0.327 n=6
Bind Time1.68s (± 0.97%)1.68s (± 0.75%)~1.66s1.69sp=0.681 n=6
Check Time16.75s (± 0.41%)16.74s (± 0.47%)~16.61s16.81sp=1.000 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time22.34s (± 0.40%)22.35s (± 0.38%)~22.24s22.43sp=1.000 n=6
xstate - node (v18.15.0, x64)
Memory used513,030k (± 0.02%)513,070k (± 0.01%)~512,997k513,150kp=0.471 n=6
Parse Time3.95s (± 0.44%)3.96s (± 0.89%)~3.91s4.00sp=0.807 n=6
Bind Time1.86s (± 0.99%)1.85s (± 1.06%)~1.84s1.88sp=0.806 n=6
Check Time3.39s (± 0.94%)3.38s (± 0.44%)~3.37s3.40sp=1.000 n=6
Emit Time0.09s (± 6.44%)0.09s (± 5.95%)~0.08s0.09sp=0.640 n=6
Total Time9.28s (± 0.61%)9.29s (± 0.52%)~9.21s9.33sp=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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

tsserver

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,376ms (± 0.69%)2,368ms (± 1.07%)~2,329ms2,397msp=0.936 n=6
Req 2 - geterr5,592ms (± 0.66%)5,639ms (± 1.60%)~5,553ms5,806msp=0.471 n=6
Req 3 - references319ms (± 0.80%)318ms (± 0.40%)~316ms320msp=0.924 n=6
Req 4 - navto273ms (± 0.00%)273ms (± 0.65%)~269ms274msp=1.000 n=6
Req 5 - completionInfo count1,357 (± 0.00%)1,357 (± 0.00%)~1,3571,357p=1.000 n=6
Req 5 - completionInfo87ms (± 0.60%)89ms (± 4.72%)~86ms97msp=0.386 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,495ms (± 0.90%)2,508ms (± 1.11%)~2,468ms2,536msp=0.575 n=6
Req 2 - geterr4,114ms (± 0.18%)4,117ms (± 0.32%)~4,102ms4,136msp=0.873 n=6
Req 3 - references333ms (± 0.15%)332ms (± 0.66%)~328ms334msp=0.242 n=6
Req 4 - navto295ms (± 0.21%)295ms (± 0.40%)~293ms296msp=1.000 n=6
Req 5 - completionInfo count1,519 (± 0.00%)1,519 (± 0.00%)~1,5191,519p=1.000 n=6
Req 5 - completionInfo73ms (± 0.70%)74ms (± 0.70%)~73ms74msp=0.311 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,608ms (± 0.44%)2,607ms (± 0.20%)~2,601ms2,615msp=0.423 n=6
Req 2 - geterr1,738ms (± 2.17%)1,715ms (± 2.35%)~1,667ms1,782msp=0.298 n=6
Req 3 - references124ms (± 0.94%)119ms (± 8.74%)~104ms129msp=0.625 n=6
Req 4 - navto367ms (± 1.10%)369ms (± 0.93%)~363ms373msp=0.517 n=6
Req 5 - completionInfo count2,079 (± 0.00%)2,079 (± 0.00%)~2,0792,079p=1.000 n=6
Req 5 - completionInfo310ms (± 1.82%)311ms (± 1.73%)~304ms317msp=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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time153.28ms (± 0.17%)153.16ms (± 0.16%)-0.12ms (- 0.08%)152.12ms155.32msp=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time226.16ms (± 0.15%)226.02ms (± 0.17%)-0.14ms (- 0.06%)224.41ms232.67msp=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time221.82ms (± 0.15%)221.79ms (± 0.17%)~220.27ms227.19msp=0.374 n=600
typescript-startup - node (v18.15.0, x64)
Execution time221.13ms (± 0.17%)221.10ms (± 0.18%)~219.64ms226.20msp=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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@jakebailey
Jake Bailey (jakebailey) merged commit 3c0a802 into microsoft:mainMar 25, 2024
@jakebailey
Jake Bailey (jakebailey) deleted the no-buffer branch March 25, 2024 17:50
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamFor Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jakebailey@typescript-bot@sheetalkamat