Skip to content

Perform bounds-checking on string input in scanner - #58362

Closed
Ron Buckton (rbuckton) wants to merge 2 commits into
mainfrom
scanner-perf
Closed

Perform bounds-checking on string input in scanner#58362
Ron Buckton (rbuckton) wants to merge 2 commits into
mainfrom
scanner-perf

Conversation

@rbuckton

@rbucktonRon Buckton (rbuckton) commented Apr 29, 2024

Copy link
Copy Markdown
Contributor

Following on to #58339, this performs the same bounds checking throughout most of the rest of the scanner.

This also adds the local/bounds-check lint rule to warn if future changes incorrectly perform unchecked calls to charCodeAt or codePointAt on text. The lint rule performs some rudimentary analysis to determine whether a call to codePointUnchecked or charCodeUnchecked follows a valid boundary check to cut down on excess // eslint-disable-line comments for cases like these:

while(pos<end){constch=charCodeUnchecked(pos);// ok, checked on preceding line
...
}
if(pos+1<end&&charCodeUnchecked(pos+1)===CharacterCodes._) ...

@rbuckton

Copy link
Copy Markdown
ContributorAuthor

TypeScript Bot (@typescript-bot) perf test

@typescript-bot

TypeScript Bot (typescript-bot) commented Apr 29, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test✅ Started❌ Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Ron Buckton (@rbuckton), the perf run you requested failed. You can check the log here.

1 similar comment
@typescript-bot

Copy link
Copy Markdown
Contributor

Ron Buckton (@rbuckton), the perf run you requested failed. You can check the log here.

@jakebailey

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) perf test

@typescript-bot

TypeScript Bot (typescript-bot) commented Apr 29, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test✅ 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
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15462,154~~~p=1.000 n=6
Types50,27350,273~~~p=1.000 n=6
Memory used193,392k (± 0.93%)192,225k (± 0.07%)~192,128k192,499kp=0.575 n=6
Parse Time1.55s (± 1.93%)1.56s (± 0.91%)~1.54s1.58sp=0.683 n=6
Bind Time0.86s (± 0.94%)0.87s (± 1.03%)~0.86s0.88sp=0.176 n=6
Check Time11.32s (± 0.43%)11.35s (± 0.36%)~11.32s11.43sp=0.935 n=6
Emit Time3.12s (± 0.26%)3.13s (± 0.37%)~3.12s3.15sp=0.271 n=6
Total Time16.87s (± 0.49%)16.91s (± 0.23%)~16.88s16.99sp=0.260 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols945,172945,172~~~p=1.000 n=6
Types408,068408,068~~~p=1.000 n=6
Memory used1,222,007k (± 0.00%)1,222,031k (± 0.00%)~1,221,973k1,222,099kp=0.471 n=6
Parse Time8.08s (± 0.33%)8.11s (± 0.71%)~8.06s8.22sp=0.293 n=6
Bind Time2.24s (± 0.54%)2.25s (± 0.73%)~2.22s2.26sp=0.323 n=6
Check Time36.62s (± 0.35%)36.59s (± 0.29%)~36.41s36.67sp=0.809 n=6
Emit Time17.36s (± 0.91%)17.34s (± 0.75%)~17.09s17.44sp=0.748 n=6
Total Time64.30s (± 0.31%)64.28s (± 0.32%)~64.07s64.58sp=0.936 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,955,8701,955,870~~~p=1.000 n=6
Types676,290676,290~~~p=1.000 n=6
Memory used1,754,501k (± 0.00%)1,754,537k (± 0.00%)~1,754,508k1,754,576kp=0.093 n=6
Parse Time9.79s (± 0.45%)9.84s (± 0.29%)~9.81s9.89sp=0.064 n=6
Bind Time3.34s (± 0.62%)3.35s (± 0.65%)~3.32s3.37sp=0.624 n=6
Check Time82.19s (± 0.60%)82.18s (± 0.44%)~81.68s82.67sp=1.000 n=6
Emit Time0.20s (± 2.62%)0.20s (± 2.06%)~0.19s0.20sp=0.595 n=6
Total Time95.50s (± 0.55%)95.56s (± 0.38%)~95.02s96.04sp=0.810 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,215,7081,215,710+2 (+ 0.00%)~~p=0.001 n=6
Types257,646257,646~~~p=1.000 n=6
Memory used2,382,660k (± 6.03%)2,324,303k (± 0.03%)~2,323,630k2,325,014kp=0.689 n=6
Parse Time7.41s (± 0.90%)7.46s (± 0.46%)~7.40s7.50sp=0.173 n=6
Bind Time2.74s (± 0.84%)2.74s (± 0.78%)~2.72s2.78sp=0.871 n=6
Check Time49.45s (± 1.04%)49.37s (± 0.26%)~49.19s49.55sp=0.378 n=6
Emit Time3.86s (± 1.59%)3.88s (± 1.59%)~3.78s3.96sp=0.575 n=6
Total Time63.50s (± 0.81%)63.46s (± 0.14%)~63.33s63.57sp=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,215,7081,215,710+2 (+ 0.00%)~~p=0.001 n=6
Types257,646257,646~~~p=1.000 n=6
Memory used2,398,508k (± 0.02%)2,398,813k (± 0.02%)~2,398,311k2,399,276kp=0.298 n=6
Parse Time6.20s (± 1.29%)6.22s (± 0.88%)~6.15s6.29sp=0.574 n=6
Bind Time2.00s (± 1.12%)2.00s (± 1.13%)~1.98s2.04sp=1.000 n=6
Check Time40.45s (± 0.19%)40.47s (± 0.17%)~40.41s40.60sp=0.810 n=6
Emit Time3.18s (± 3.16%)3.12s (± 1.96%)~3.04s3.19sp=0.470 n=6
Total Time51.85s (± 0.42%)51.83s (± 0.23%)~51.61s51.94sp=0.936 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols256,204256,206+2 (+ 0.00%)~~p=0.001 n=6
Types103,653103,653~~~p=1.000 n=6
Memory used424,297k (± 0.01%)424,263k (± 0.01%)~424,219k424,332kp=0.128 n=6
Parse Time4.17s (± 0.71%)4.20s (± 0.85%)~4.14s4.24sp=0.053 n=6
Bind Time1.59s (± 1.40%)1.61s (± 1.11%)~1.59s1.64sp=0.224 n=6
Check Time22.60s (± 0.35%)22.66s (± 0.23%)~22.56s22.71sp=0.149 n=6
Emit Time1.71s (± 1.32%)1.73s (± 2.13%)~1.67s1.78sp=0.421 n=6
Total Time30.07s (± 0.37%)30.20s (± 0.23%)~30.13s30.30sp=0.065 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,824224,824~~~p=1.000 n=6
Types93,39093,390~~~p=1.000 n=6
Memory used369,332k (± 0.02%)369,393k (± 0.02%)~369,343k369,493kp=0.230 n=6
Parse Time2.31s (± 0.81%)2.35s (± 0.70%)+0.05s (+ 2.17%)2.33s2.37sp=0.010 n=6
Bind Time1.35s (± 1.46%)1.34s (± 1.79%)~1.31s1.38sp=0.548 n=6
Check Time13.34s (± 0.31%)13.33s (± 0.29%)~13.28s13.39sp=0.687 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time17.00s (± 0.20%)17.03s (± 0.27%)~16.96s17.08sp=0.197 n=6
vscode - node (v18.15.0, x64)
Errors44~~~p=1.000 n=6
Symbols2,799,0242,799,024~~~p=1.000 n=6
Types950,803950,803~~~p=1.000 n=6
Memory used2,926,630k (± 0.00%)2,926,632k (± 0.00%)~2,926,454k2,926,741kp=0.810 n=6
Parse Time11.17s (± 0.35%)11.21s (± 0.26%)~11.18s11.26sp=0.107 n=6
Bind Time3.42s (± 0.26%)3.45s (± 1.90%)~3.41s3.58sp=0.563 n=6
Check Time62.88s (± 0.25%)62.97s (± 0.27%)~62.70s63.15sp=0.574 n=6
Emit Time17.72s (± 9.57%)17.81s (± 9.82%)~16.60s20.14sp=0.575 n=6
Total Time95.19s (± 1.76%)95.44s (± 1.80%)~94.10s97.68sp=0.471 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols265,853265,853~~~p=1.000 n=6
Types108,438108,438~~~p=1.000 n=6
Memory used410,323k (± 0.01%)410,338k (± 0.01%)~410,302k410,453kp=0.936 n=6
Parse Time3.80s (± 0.47%)3.83s (± 0.68%)~3.78s3.85sp=0.063 n=6
Bind Time1.66s (± 0.92%)1.66s (± 0.63%)~1.64s1.67sp=0.934 n=6
Check Time17.03s (± 0.27%)17.02s (± 0.38%)~16.93s17.13sp=0.574 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.48s (± 0.24%)22.50s (± 0.31%)~22.42s22.62sp=0.935 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols523,981523,981~~~p=1.000 n=6
Types178,708178,708~~~p=1.000 n=6
Memory used461,252k (± 0.02%)461,310k (± 0.03%)~461,170k461,520kp=0.378 n=6
Parse Time3.12s (± 0.85%)3.15s (± 1.12%)~3.11s3.21sp=0.167 n=6
Bind Time1.19s (± 0.34%)1.19s~~~p=0.405 n=6
Check Time18.21s (± 0.51%)18.27s (± 0.40%)~18.18s18.37sp=0.336 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.52s (± 0.32%)22.61s (± 0.37%)~22.49s22.70sp=0.092 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - 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,297ms (± 0.43%)2,301ms (± 0.31%)~2,294ms2,311msp=0.630 n=6
Req 2 - geterr5,127ms (± 0.42%)5,145ms (± 0.61%)~5,114ms5,188msp=0.575 n=6
Req 3 - references286ms (± 2.14%)288ms (± 1.60%)~283ms292msp=0.166 n=6
Req 4 - navto227ms (± 0.60%)226ms (± 0.56%)~224ms227msp=0.283 n=6
Req 5 - completionInfo count1,3571,357~~~p=1.000 n=6
Req 5 - completionInfo81ms (± 7.99%)84ms (± 9.38%)~77ms93msp=0.528 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen3,583ms (± 0.60%)3,607ms (± 0.55%)~3,573ms3,624msp=0.066 n=6
Req 2 - geterr5,691ms (± 0.16%)5,683ms (± 0.16%)~5,670ms5,691msp=0.128 n=6
Req 3 - references443ms (± 0.19%)448ms (± 0.30%)+5ms (+ 1.17%)446ms449msp=0.004 n=6
Req 4 - navto339ms (± 0.16%)339ms (± 0.15%)~338ms339msp=0.640 n=6
Req 5 - completionInfo count1,5191,519~~~p=1.000 n=6
Req 5 - completionInfo108ms (± 1.12%)112ms (± 5.84%)~109ms125msp=0.115 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen5,105ms (± 0.37%)5,138ms (± 0.32%)+32ms (+ 0.63%)5,110ms5,158msp=0.020 n=6
Req 2 - geterr1,129ms (± 0.79%)1,127ms (± 0.20%)~1,124ms1,130msp=0.872 n=6
Req 3 - references87ms (± 3.85%)86ms (± 0.98%)~84ms86msp=0.928 n=6
Req 4 - navto450ms (± 0.91%)449ms (± 0.23%)~447ms450msp=1.000 n=6
Req 5 - completionInfo count3,4133,413~~~p=1.000 n=6
Req 5 - completionInfo859ms (± 3.26%)835ms (± 0.39%)-25ms (- 2.85%)829ms838msp=0.010 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)
  • xstate-main-1-tsserver - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time156.33ms (± 0.16%)156.42ms (± 0.17%)+0.09ms (+ 0.06%)155.39ms159.28msp=0.004 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time239.28ms (± 0.14%)239.33ms (± 0.15%)~237.95ms246.14msp=0.210 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time348.76ms (± 0.30%)348.86ms (± 0.30%)~341.33ms359.12msp=0.197 n=600
typescript-startup - node (v18.15.0, x64)
Execution time350.20ms (± 0.29%)350.32ms (± 0.29%)+0.12ms (+ 0.04%)341.82ms354.16msp=0.010 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

@typescript-bot

Copy link
Copy Markdown
Contributor

Ron Buckton (@rbuckton)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15462,154~~~p=1.000 n=6
Types50,27350,273~~~p=1.000 n=6
Memory used193,925k (± 1.01%)193,337k (± 0.95%)~192,118k195,699kp=0.575 n=6
Parse Time1.57s (± 1.53%)1.57s (± 1.32%)~1.54s1.59sp=0.870 n=6
Bind Time0.87s (± 0.86%)0.87s (± 1.03%)~0.86s0.88sp=0.798 n=6
Check Time11.35s (± 0.29%)11.37s (± 0.48%)~11.28s11.43sp=0.422 n=6
Emit Time3.15s (± 0.31%)3.14s (± 0.37%)~3.12s3.15sp=0.498 n=6
Total Time16.93s (± 0.22%)16.95s (± 0.41%)~16.83s17.03sp=0.521 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols945,172945,172~~~p=1.000 n=6
Types408,068408,068~~~p=1.000 n=6
Memory used1,222,067k (± 0.00%)1,222,039k (± 0.00%)~1,221,978k1,222,090kp=0.298 n=6
Parse Time8.09s (± 0.26%)8.12s (± 0.61%)~8.08s8.21sp=0.227 n=6
Bind Time2.24s (± 0.69%)2.24s (± 0.59%)~2.23s2.26sp=0.796 n=6
Check Time36.67s (± 0.38%)36.62s (± 0.32%)~36.52s36.77sp=0.575 n=6
Emit Time17.40s (± 0.89%)17.39s (± 0.63%)~17.28s17.53sp=0.574 n=6
Total Time64.40s (± 0.35%)64.38s (± 0.34%)~64.18s64.71sp=1.000 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,955,8701,955,870~~~p=1.000 n=6
Types676,290676,290~~~p=1.000 n=6
Memory used1,754,554k (± 0.00%)1,754,545k (± 0.00%)~1,754,500k1,754,646kp=1.000 n=6
Parse Time9.79s (± 0.38%)9.76s (± 0.49%)~9.68s9.80sp=0.191 n=6
Bind Time3.33s (± 0.64%)3.34s (± 0.41%)~3.32s3.36sp=0.742 n=6
Check Time81.73s (± 0.35%)82.14s (± 0.63%)~81.60s82.99sp=0.128 n=6
Emit Time0.19s (± 2.67%)0.19s (± 2.67%)~0.19s0.20sp=1.000 n=6
Total Time95.04s (± 0.31%)95.44s (± 0.58%)~94.87s96.35sp=0.199 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,215,7081,215,710+2 (+ 0.00%)~~p=0.001 n=6
Types257,646257,646~~~p=1.000 n=6
Memory used2,324,373k (± 0.02%)2,324,231k (± 0.02%)~2,323,755k2,324,828kp=0.471 n=6
Parse Time7.45s (± 0.52%)7.48s (± 0.94%)~7.37s7.57sp=0.127 n=6
Bind Time2.74s (± 0.43%)2.73s (± 1.05%)~2.69s2.78sp=0.372 n=6
Check Time49.42s (± 0.69%)49.45s (± 0.60%)~49.18s50.00sp=1.000 n=6
Emit Time3.86s (± 0.97%)4.01s (± 3.92%)+0.15s (+ 3.80%)3.86s4.24sp=0.030 n=6
Total Time63.47s (± 0.50%)63.70s (± 0.52%)~63.32s64.30sp=0.173 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,215,7081,215,710+2 (+ 0.00%)~~p=0.001 n=6
Types257,646257,646~~~p=1.000 n=6
Memory used2,398,520k (± 0.02%)2,398,575k (± 0.02%)~2,398,103k2,399,388kp=0.810 n=6
Parse Time7.71s (± 1.25%)7.78s (± 0.96%)~7.71s7.92sp=0.298 n=6
Bind Time2.46s (± 0.95%)2.46s (± 1.23%)~2.41s2.49sp=0.686 n=6
Check Time50.10s (± 0.31%)50.15s (± 0.25%)~50.00s50.32sp=0.470 n=6
Emit Time3.91s (± 1.72%)3.85s (± 2.22%)~3.69s3.91sp=0.230 n=6
Total Time64.19s (± 0.26%)64.23s (± 0.39%)~63.88s64.58sp=0.936 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols256,204256,206+2 (+ 0.00%)~~p=0.001 n=6
Types103,653103,653~~~p=1.000 n=6
Memory used424,319k (± 0.02%)424,278k (± 0.01%)~424,202k424,371kp=0.173 n=6
Parse Time4.14s (± 0.62%)4.17s (± 1.76%)~4.03s4.23sp=0.147 n=6
Bind Time1.60s (± 1.88%)1.62s (± 1.28%)~1.59s1.65sp=0.368 n=6
Check Time22.62s (± 0.49%)22.64s (± 0.40%)~22.51s22.77sp=0.872 n=6
Emit Time1.71s (± 2.68%)1.74s (± 1.33%)~1.72s1.78sp=0.196 n=6
Total Time30.08s (± 0.27%)30.16s (± 0.40%)~30.03s30.33sp=0.336 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,824224,824~~~p=1.000 n=6
Types93,39093,390~~~p=1.000 n=6
Memory used369,325k (± 0.01%)369,367k (± 0.02%)~369,313k369,439kp=0.423 n=6
Parse Time2.84s (± 0.77%)2.88s (± 0.86%)+0.04s (+ 1.35%)2.85s2.92sp=0.029 n=6
Bind Time1.58s (± 1.01%)1.59s (± 0.86%)~1.57s1.60sp=0.680 n=6
Check Time15.72s (± 0.18%)15.73s (± 0.19%)~15.69s15.77sp=0.686 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.14s (± 0.21%)20.18s (± 0.21%)~20.11s20.22sp=0.091 n=6
vscode - node (v18.15.0, x64)
Errors44~~~p=1.000 n=6
Symbols2,799,0242,799,024~~~p=1.000 n=6
Types950,803950,803~~~p=1.000 n=6
Memory used2,926,944k (± 0.02%)2,926,664k (± 0.00%)~2,926,478k2,926,780kp=0.936 n=6
Parse Time11.12s (± 0.16%)11.22s (± 0.42%)+0.10s (+ 0.88%)11.16s11.29sp=0.005 n=6
Bind Time3.42s (± 0.22%)3.44s (± 2.11%)~3.40s3.59sp=0.620 n=6
Check Time62.97s (± 0.36%)63.02s (± 0.21%)~62.87s63.23sp=0.575 n=6
Emit Time17.74s (± 7.33%)17.69s (± 9.62%)~16.49s19.90sp=0.630 n=6
Total Time95.26s (± 1.21%)95.37s (± 1.77%)~94.09s97.65sp=1.000 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols265,853265,853~~~p=1.000 n=6
Types108,438108,438~~~p=1.000 n=6
Memory used410,381k (± 0.01%)410,451k (± 0.02%)~410,377k410,567kp=0.297 n=6
Parse Time3.21s (± 0.96%)3.20s (± 0.46%)~3.18s3.22sp=1.000 n=6
Bind Time1.41s (± 0.97%)1.40s (± 1.08%)~1.38s1.42sp=0.273 n=6
Check Time14.45s (± 0.38%)14.51s (± 0.63%)~14.41s14.63sp=0.470 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time19.07s (± 0.45%)19.10s (± 0.48%)~19.01s19.23sp=0.377 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols523,981523,981~~~p=1.000 n=6
Types178,708178,708~~~p=1.000 n=6
Memory used461,344k (± 0.03%)461,268k (± 0.01%)~461,192k461,361kp=0.230 n=6
Parse Time2.60s (± 0.51%)2.62s (± 0.24%)+0.02s (+ 0.70%)2.61s2.63sp=0.009 n=6
Bind Time0.99s (± 0.82%)1.00s (± 0.52%)~0.99s1.00sp=0.523 n=6
Check Time15.36s (± 0.60%)15.32s (± 0.10%)~15.30s15.34sp=0.520 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time18.95s (± 0.43%)18.93s (± 0.09%)~18.91s18.96sp=0.748 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

tsserver

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen3,428ms (± 0.43%)3,422ms (± 0.23%)~3,410ms3,430msp=0.630 n=6
Req 2 - geterr7,591ms (± 0.41%)7,545ms (± 0.67%)~7,472ms7,601msp=0.128 n=6
Req 3 - references430ms (± 1.52%)434ms (± 1.42%)~425ms440msp=0.422 n=6
Req 4 - navto337ms (± 0.51%)339ms (± 0.44%)~337ms341msp=0.210 n=6
Req 5 - completionInfo count1,3571,357~~~p=1.000 n=6
Req 5 - completionInfo117ms (± 9.12%)113ms (± 2.27%)~111ms118msp=1.000 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen3,583ms (± 0.18%)3,612ms (± 0.23%)+29ms (+ 0.80%)3,600ms3,620msp=0.005 n=6
Req 2 - geterr5,675ms (± 0.39%)5,684ms (± 0.36%)~5,650ms5,704msp=0.378 n=6
Req 3 - references443ms (± 0.39%)448ms (± 0.41%)+5ms (+ 1.13%)446ms450msp=0.007 n=6
Req 4 - navto339ms (± 0.83%)341ms (± 1.19%)~338ms349msp=0.267 n=6
Req 5 - completionInfo count1,5191,519~~~p=1.000 n=6
Req 5 - completionInfo108ms (± 1.12%)112ms (± 5.87%)~108ms125msp=0.210 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen6,249ms (± 5.79%)6,159ms (± 0.40%)~6,125ms6,184msp=0.078 n=6
Req 2 - geterr1,402ms (± 9.97%)1,351ms (± 1.14%)~1,328ms1,375msp=0.872 n=6
Req 3 - references114ms (±13.31%)104ms (± 3.86%)~100ms108msp=0.220 n=6
Req 4 - navto568ms (± 3.40%)541ms (± 7.85%)~497ms610msp=0.199 n=6
Req 5 - completionInfo count3,4133,413~~~p=1.000 n=6
Req 5 - completionInfo1,160ms (±10.71%)1,128ms (±10.59%)~1,019ms1,297msp=0.810 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)
  • xstate-main-1-tsserver - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time156.52ms (± 0.17%)156.47ms (± 0.18%)-0.05ms (- 0.03%)155.42ms160.08msp=0.047 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time240.16ms (± 0.22%)240.30ms (± 0.14%)+0.14ms (+ 0.06%)238.85ms244.66msp=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time286.24ms (± 0.28%)286.21ms (± 0.29%)~279.04ms289.63msp=0.913 n=600
typescript-startup - node (v18.15.0, x64)
Execution time287.33ms (± 0.28%)287.25ms (± 0.28%)~280.53ms293.62msp=0.225 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

@rbuckton

Copy link
Copy Markdown
ContributorAuthor

Looks like there was no noticeable performance improvement with this change, so we should only take it if we think the bounds checking enforcement is worth adding purely for the sake of correctness and stability.

@DanielRosenwasser

Copy link
Copy Markdown
Member

It seems like parse is (only very slightly) worse - I wonder what happens if you switch that initial call in scan to the old unchecked version, but I'm guessing it's more death by a thousand cuts.

@rbuckton

Copy link
Copy Markdown
ContributorAuthor

It may be that some code paths aren't run enough times to be optimized and thus the functions aren't inlined. I'll have to look at it in deopt-explorer.

@typescript-bot

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Jun 23, 2026
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

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants

@rbuckton@typescript-bot@jakebailey@DanielRosenwasser@sandersn@RyanCavanaugh