Skip to content

Enable JS emit for noCheck and noCheck for transpileModule - #58364

Merged
Wesley Wigham (weswigham) merged 7 commits into
microsoft:mainfrom
weswigham:nocheck-js-emit
May 30, 2024
Merged

Enable JS emit for noCheck and noCheck for transpileModule#58364
Wesley Wigham (weswigham) merged 7 commits into
microsoft:mainfrom
weswigham:nocheck-js-emit

Conversation

@weswigham

@weswighamWesley Wigham (weswigham) commented Apr 29, 2024

Copy link
Copy Markdown
Member

This PR enables noCheck for JS emit, and tests all js emit tests with noCheck, just as we do declaration emit tests with noCheck. It also enables noCheck for transpileModule by default.

@weswigham

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test this faster

@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 this faster✅ Started👀 Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Wesley Wigham (@weswigham)
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,157+3 (+ 0.00%)~~p=0.001 n=6
Types50,27350,284+11 (+ 0.02%)~~p=0.001 n=6
Memory used194,036k (± 1.01%)206,867k (± 0.54%)🔻+12,831k (+ 6.61%)205,758k207,973kp=0.005 n=6
Parse Time1.30s (± 0.42%)1.29s (± 1.24%)~1.27s1.31sp=0.055 n=6
Bind Time0.72s0.72s~~~p=1.000 n=6
Check Time9.58s (± 0.31%)10.16s (± 0.56%)🔻+0.58s (+ 6.05%)10.12s10.25sp=0.005 n=6
Emit Time2.62s (± 0.78%)4.18s (± 0.72%)🔻+1.56s (+59.52%)4.14s4.23sp=0.005 n=6
Total Time14.23s (± 0.24%)16.35s (± 0.40%)🔻+2.12s (+14.87%)16.28s16.43sp=0.005 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols945,172945,778+606 (+ 0.06%)~~p=0.001 n=6
Types408,068408,353+285 (+ 0.07%)~~p=0.001 n=6
Memory used1,222,051k (± 0.01%)1,249,000k (± 0.00%)+26,950k (+ 2.21%)1,248,916k1,249,055kp=0.005 n=6
Parse Time8.05s (± 0.36%)8.04s (± 0.42%)~8.01s8.10sp=0.629 n=6
Bind Time2.21s (± 0.62%)2.22s (± 0.57%)~2.21s2.24sp=0.357 n=6
Check Time36.43s (± 0.33%)39.06s (± 0.40%)🔻+2.64s (+ 7.24%)38.83s39.25sp=0.005 n=6
Emit Time17.34s (± 0.86%)22.40s (± 0.53%)🔻+5.06s (+29.18%)22.28s22.58sp=0.005 n=6
Total Time64.03s (± 0.31%)71.72s (± 0.23%)🔻+7.69s (+12.01%)71.47s71.86sp=0.005 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,955,8701,956,035+165 (+ 0.01%)~~p=0.001 n=6
Types676,290676,309+19 (+ 0.00%)~~p=0.001 n=6
Memory used1,754,563k (± 0.00%)1,758,450k (± 0.00%)+3,887k (+ 0.22%)1,758,404k1,758,494kp=0.005 n=6
Parse Time6.71s (± 0.32%)6.71s (± 0.42%)~6.69s6.75sp=0.934 n=6
Bind Time2.31s (± 0.45%)2.30s (± 1.27%)~2.25s2.33sp=1.000 n=6
Check Time56.87s (± 0.50%)57.59s (± 0.32%)+0.72s (+ 1.27%)57.26s57.82sp=0.005 n=6
Emit Time0.13s (± 3.87%)0.14s (± 4.51%)~0.13s0.15sp=0.091 n=6
Total Time66.02s (± 0.46%)66.75s (± 0.26%)+0.72s (+ 1.09%)66.44s66.98sp=0.005 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,215,7081,216,393+685 (+ 0.06%)~~p=0.001 n=6
Types257,646257,862+216 (+ 0.08%)~~p=0.001 n=6
Memory used2,323,836k (± 0.03%)2,332,963k (± 0.02%)+9,127k (+ 0.39%)2,332,530k2,333,620kp=0.005 n=6
Parse Time5.94s (± 0.73%)5.93s (± 1.07%)~5.86s6.00sp=0.689 n=6
Bind Time2.21s (± 1.01%)2.21s (± 1.05%)~2.18s2.25sp=0.936 n=6
Check Time39.91s (± 0.28%)42.90s (± 0.50%)🔻+2.99s (+ 7.50%)42.63s43.24sp=0.005 n=6
Emit Time3.13s (± 4.95%)3.13s (± 1.27%)~3.07s3.18sp=0.630 n=6
Total Time51.23s (± 0.47%)54.21s (± 0.45%)🔻+2.98s (+ 5.82%)54.01s54.61sp=0.005 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,215,7081,216,393+685 (+ 0.06%)~~p=0.001 n=6
Types257,646257,862+216 (+ 0.08%)~~p=0.001 n=6
Memory used2,398,433k (± 0.02%)2,407,755k (± 0.02%)+9,322k (+ 0.39%)2,406,735k2,408,266kp=0.005 n=6
Parse Time5.11s (± 0.64%)5.10s (± 0.69%)~5.07s5.15sp=0.335 n=6
Bind Time1.67s (± 0.80%)1.68s (± 0.63%)~1.66s1.69sp=0.358 n=6
Check Time34.45s (± 0.32%)36.55s (± 0.42%)🔻+2.10s (+ 6.11%)36.26s36.68sp=0.005 n=6
Emit Time2.66s (± 0.97%)2.68s (± 3.69%)~2.54s2.80sp=0.870 n=6
Total Time43.92s (± 0.17%)46.03s (± 0.42%)🔻+2.11s (+ 4.81%)45.64s46.14sp=0.005 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols256,204256,501+297 (+ 0.12%)~~p=0.001 n=6
Types103,653103,740+87 (+ 0.08%)~~p=0.001 n=6
Memory used424,273k (± 0.01%)428,151k (± 0.01%)+3,879k (+ 0.91%)428,112k428,210kp=0.005 n=6
Parse Time2.76s (± 1.59%)2.77s (± 0.40%)~2.76s2.78sp=0.869 n=6
Bind Time1.10s (± 1.86%)1.09s (± 0.37%)~1.09s1.10sp=1.000 n=6
Check Time15.49s (± 0.33%)16.45s (± 0.44%)🔻+0.96s (+ 6.19%)16.36s16.54sp=0.005 n=6
Emit Time1.15s (± 1.53%)1.16s (± 2.07%)~1.12s1.19sp=0.193 n=6
Total Time20.49s (± 0.29%)21.47s (± 0.31%)🔻+0.98s (+ 4.80%)21.41s21.57sp=0.005 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,824224,980+156 (+ 0.07%)~~p=0.001 n=6
Types93,39093,429+39 (+ 0.04%)~~p=0.001 n=6
Memory used369,357k (± 0.03%)372,388k (± 0.01%)+3,032k (+ 0.82%)372,344k372,458kp=0.005 n=6
Parse Time2.83s (± 1.12%)2.86s (± 1.83%)~2.82s2.96sp=0.809 n=6
Bind Time1.59s (± 1.01%)1.55s (± 3.98%)~1.43s1.59sp=0.213 n=6
Check Time15.71s (± 0.29%)16.78s (± 0.36%)🔻+1.07s (+ 6.82%)16.71s16.88sp=0.005 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.13s (± 0.34%)21.20s (± 0.28%)🔻+1.07s (+ 5.30%)21.11s21.27sp=0.005 n=6
vscode - node (v18.15.0, x64)
Errors44~~~p=1.000 n=6
Symbols2,799,0242,804,031+5,007 (+ 0.18%)~~p=0.001 n=6
Types950,803952,904+2,101 (+ 0.22%)~~p=0.001 n=6
Memory used2,926,597k (± 0.01%)3,078,559k (± 0.00%)🔻+151,962k (+ 5.19%)3,078,514k3,078,624kp=0.005 n=6
Parse Time13.34s (± 0.22%)13.34s (± 0.29%)~13.29s13.41sp=0.511 n=6
Bind Time4.09s (± 0.46%)4.10s (± 0.24%)~4.09s4.11sp=0.805 n=6
Check Time73.01s (± 0.24%)85.83s (± 0.63%)🔻+12.82s (+17.56%)85.32s86.66sp=0.005 n=6
Emit Time19.77s (± 2.11%)48.37s (± 1.00%)🔻+28.60s (+144.66%)47.75s48.89sp=0.005 n=6
Total Time110.21s (± 0.31%)151.65s (± 0.65%)🔻+41.44s (+37.60%)150.52s152.93sp=0.005 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols265,853265,879+26 (+ 0.01%)~~p=0.001 n=6
Types108,438108,441+3 (+ 0.00%)~~p=0.001 n=6
Memory used410,473k (± 0.03%)412,580k (± 0.02%)+2,107k (+ 0.51%)412,467k412,710kp=0.005 n=6
Parse Time4.80s (± 0.80%)4.78s (± 0.67%)~4.74s4.83sp=0.469 n=6
Bind Time2.07s (± 0.94%)2.08s (± 0.36%)~2.07s2.09sp=0.503 n=6
Check Time21.14s (± 0.23%)22.10s (± 0.20%)🔻+0.95s (+ 4.50%)22.04s22.15sp=0.005 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time28.01s (± 0.28%)28.96s (± 0.22%)+0.95s (+ 3.37%)28.87s29.01sp=0.005 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols523,981524,011+30 (+ 0.01%)~~p=0.001 n=6
Types178,708178,708~~~p=1.000 n=6
Memory used461,306k (± 0.02%)462,269k (± 0.02%)+963k (+ 0.21%)462,177k462,387kp=0.005 n=6
Parse Time3.11s (± 0.52%)3.14s (± 0.57%)+0.03s (+ 0.86%)3.11s3.16sp=0.041 n=6
Bind Time1.18s (± 0.54%)1.18s (± 0.44%)~1.18s1.19sp=0.386 n=6
Check Time18.18s (± 0.78%)18.54s (± 0.63%)+0.37s (+ 2.02%)18.38s18.69sp=0.005 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.47s (± 0.64%)22.87s (± 0.46%)+0.39s (+ 1.75%)22.72s23.00sp=0.005 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

Developer Information:

Download Benchmarks


!!!! File file1.js missing from original emit, but present in noCheck emit
//// [file1.js]
export const x = 3;

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

No checker error, so the emit happens. 🤷‍♂️

}
declare var k: c | m.c;
-declare var l: c | m.c;
+declare var l: m.c | c;

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Union order swaps - the EmitResolver during js+.d.ts emit happens to create these types in the reverse order of a full typecheck.

!!! related TS2304 multiLinePropertyAccessAndArrowFunctionIndent1.ts:1:18: Cannot find name 'role'.
!!! related TS2304 multiLinePropertyAccessAndArrowFunctionIndent1.ts:2:18: Cannot find name 'Role'.
!!! related TS2503 multiLinePropertyAccessAndArrowFunctionIndent1.ts:4:26: Cannot find namespace 'ng'.
!!! related TS2304 multiLinePropertyAccessAndArrowFunctionIndent1.ts:4:53: Cannot find name 'Role'.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

The top-level return is a grammar error that normally blocks us reporting all these errors. Calculating emit flags for them lazily, however, manifests these errors. Do note: this is also technically a correctness improvement - previously, block scoped bindings and the like inside a top-level return like this wouldn't get transformed according to the target because we'd assume we'd calculated their NodeCheckFlags when in fact we hadn't. Still, these errors are basically silent, even if they're reasonable, hence the warning in the error log. I could probably silence these and get the old behavior back if I really tried, I'm just not sure it's necessary.


!!!! File all.d.ts missing from original emit, but present in noCheck emit
//// [all.d.ts]
declare module "ref/a" {

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Now that this isn't emitDeclarationOnly, this configuration of compiler options is forbidden, thus produces no output again. (Even with noCheck)

declare function concat2<T extends readonly unknown[], U extends readonly unknown[]>(t: T, u: U): (T[number] | U[number])[];
-declare const tc5: (2 | 4 | 1 | 3 | 6 | 5)[];
+declare const tc5: (1 | 2 | 3 | 6 | 4 | 5)[];
+declare const tc5: (3 | 2 | 1 | 6 | 4 | 5)[];

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This union order shifts again. Presumably the EmitResolver usages in js emit tweak the order we manifest these number types in.


!!!! File autoAccessor1.js missing from original emit, but present in noCheck emit
//// [autoAccessor1.js]
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

The target error for auto-accessors, Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher. is a checker error. So when it's suppressed, we happily do emit.

@weswighamWesley Wigham (weswigham) changed the title Enable JS emit for noCheckEnable JS emit for noCheck and noCheck for transpileModuleApr 30, 2024
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.a = void 0;
-exports.a = x.c;

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I think this is a case where the noCheck output is an improvement. As a perf optimization, I made reference marking with an Unspecified hint skip all Ambient nodes - that causes this change. The export declare import statement in this file usually gets transformed into the output js, even though it has a declare modifier. That's likely because the declare modifier on an import is an error, so the alias marking is done unconditionally. In any case, since the input has a syntax/grammar type error, I think it's fine for the output to diverge a bit like this. I could bring it in-line (either by changing normal behavior to elide this, or noCheck to retain it), but I'm not sure it's worth the effort, given the error.

@weswigham

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test this faster

I still need to sprinkle around setting the calculatedFlags for nodes during the full typecheck pass (likely just by setting all of them when the node is visited), so this should still have perf impact, just less than before.

@typescript-bot

TypeScript Bot (typescript-bot) commented May 14, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test this faster✅ Started👀 Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Wesley Wigham (@weswigham)
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,155+1 (+ 0.00%)~~p=0.001 n=6
Types50,24850,251+3 (+ 0.01%)~~p=0.001 n=6
Memory used192,387k (± 0.10%)205,440k (± 0.44%)🔻+13,053k (+ 6.78%)205,031k207,300kp=0.005 n=6
Parse Time1.56s (± 0.96%)1.55s (± 1.38%)~1.52s1.57sp=0.183 n=6
Bind Time0.87s (± 1.19%)0.87s (± 1.53%)~0.86s0.89sp=0.923 n=6
Check Time11.32s (± 0.30%)11.38s (± 0.34%)+0.06s (+ 0.52%)11.32s11.42sp=0.035 n=6
Emit Time3.16s (± 0.77%)4.79s (± 0.64%)🔻+1.64s (+51.90%)4.77s4.85sp=0.005 n=6
Total Time16.91s (± 0.21%)18.59s (± 0.36%)🔻+1.68s (+ 9.93%)18.50s18.68sp=0.005 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,110944,377+267 (+ 0.03%)~~p=0.001 n=6
Types407,140407,284+144 (+ 0.04%)~~p=0.001 n=6
Memory used1,222,041k (± 0.00%)1,241,149k (± 0.00%)+19,108k (+ 1.56%)1,241,069k1,241,223kp=0.005 n=6
Parse Time8.07s (± 0.71%)8.08s (± 0.32%)~8.03s8.10sp=0.935 n=6
Bind Time2.24s (± 0.47%)2.23s (± 0.75%)~2.21s2.25sp=0.742 n=6
Check Time36.26s (± 0.47%)36.42s (± 0.40%)~36.20s36.64sp=0.148 n=6
Emit Time17.40s (± 0.38%)21.35s (± 0.69%)🔻+3.94s (+22.66%)21.16s21.53sp=0.005 n=6
Total Time63.97s (± 0.29%)68.08s (± 0.34%)🔻+4.11s (+ 6.43%)67.68s68.33sp=0.005 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,964,2761,964,276~~~p=1.000 n=6
Types819,365819,365~~~p=1.000 n=6
Memory used1,849,721k (± 0.00%)1,849,735k (± 0.00%)~1,849,667k1,849,851kp=0.810 n=6
Parse Time8.05s (± 0.52%)8.05s (± 0.36%)~8.02s8.09sp=1.000 n=6
Bind Time2.74s (± 1.23%)2.72s (± 0.45%)~2.70s2.73sp=0.103 n=6
Check Time69.19s (± 0.30%)69.30s (± 0.68%)~68.72s69.78sp=0.574 n=6
Emit Time0.17s (± 3.32%)0.17s (± 3.10%)~0.16s0.17sp=0.640 n=6
Total Time80.15s (± 0.20%)80.23s (± 0.60%)~79.64s80.70sp=0.630 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,221,2161,221,413+197 (+ 0.02%)~~p=0.001 n=6
Types259,517259,546+29 (+ 0.01%)~~p=0.001 n=6
Memory used2,337,342k (± 0.03%)2,337,909k (± 0.03%)~2,337,023k2,339,287kp=0.298 n=6
Parse Time5.05s (± 1.19%)5.00s (± 0.64%)~4.97s5.05sp=0.128 n=6
Bind Time1.88s (± 0.87%)1.89s (± 0.62%)~1.88s1.91sp=0.462 n=6
Check Time33.77s (± 0.20%)33.98s (± 0.22%)+0.20s (+ 0.60%)33.85s34.06sp=0.008 n=6
Emit Time2.66s (± 1.35%)2.68s (± 1.33%)~2.63s2.72sp=0.521 n=6
Total Time43.37s (± 0.25%)43.56s (± 0.32%)+0.19s (+ 0.43%)43.37s43.77sp=0.045 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,221,2161,221,413+197 (+ 0.02%)~~p=0.001 n=6
Types259,517259,546+29 (+ 0.01%)~~p=0.001 n=6
Memory used2,413,862k (± 0.01%)2,415,295k (± 0.01%)+1,433k (+ 0.06%)2,414,897k2,415,795kp=0.005 n=6
Parse Time7.75s (± 0.72%)7.64s (± 0.42%)-0.11s (- 1.36%)7.61s7.70sp=0.012 n=6
Bind Time2.50s (± 0.55%)2.49s (± 0.72%)~2.46s2.51sp=0.293 n=6
Check Time49.70s (± 0.23%)50.01s (± 0.28%)+0.31s (+ 0.62%)49.83s50.14sp=0.013 n=6
Emit Time3.94s (± 3.17%)3.83s (± 0.94%)~3.78s3.87sp=0.128 n=6
Total Time63.89s (± 0.32%)64.00s (± 0.27%)~63.78s64.21sp=0.298 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols256,767256,845+78 (+ 0.03%)~~p=0.001 n=6
Types104,587104,616+29 (+ 0.03%)~~p=0.001 n=6
Memory used426,112k (± 0.03%)426,413k (± 0.01%)+301k (+ 0.07%)426,362k426,466kp=0.005 n=6
Parse Time3.38s (± 0.49%)3.37s (± 0.58%)~3.34s3.39sp=0.745 n=6
Bind Time1.32s (± 0.68%)1.33s (± 0.31%)+0.01s (+ 0.88%)1.33s1.34sp=0.025 n=6
Check Time17.90s (± 0.18%)18.01s (± 0.46%)~17.86s18.10sp=0.053 n=6
Emit Time1.38s (± 0.85%)1.37s (± 1.75%)~1.34s1.40sp=0.410 n=6
Total Time23.98s (± 0.09%)24.08s (± 0.47%)~23.88s24.21sp=0.063 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,575224,575~~~p=1.000 n=6
Types93,78593,785~~~p=1.000 n=6
Memory used369,901k (± 0.03%)369,906k (± 0.03%)~369,775k370,060kp=1.000 n=6
Parse Time2.83s (± 0.41%)2.86s (± 2.04%)~2.81s2.97sp=0.569 n=6
Bind Time1.58s (± 0.74%)1.56s (± 3.93%)~1.44s1.61sp=0.934 n=6
Check Time15.67s (± 0.39%)15.74s (± 0.19%)+0.08s (+ 0.49%)15.70s15.78sp=0.037 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.07s (± 0.35%)20.16s (± 0.25%)+0.09s (+ 0.42%)20.08s20.21sp=0.043 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,823,5552,825,537+1,982 (+ 0.07%)~~p=0.001 n=6
Types957,785958,891+1,106 (+ 0.12%)~~p=0.001 n=6
Memory used2,995,829k (± 0.00%)3,118,275k (± 0.00%)🔻+122,446k (+ 4.09%)3,118,194k3,118,353kp=0.005 n=6
Parse Time16.92s (± 0.14%)16.95s (± 0.25%)~16.90s17.01sp=0.226 n=6
Bind Time5.01s (± 0.28%)5.00s (± 0.21%)~4.98s5.01sp=0.118 n=6
Check Time88.58s (± 0.49%)88.50s (± 0.29%)~88.14s88.89sp=0.423 n=6
Emit Time28.64s (± 0.47%)46.72s (± 0.64%)🔻+18.08s (+63.14%)46.38s47.10sp=0.005 n=6
Total Time139.14s (± 0.34%)157.17s (± 0.25%)🔻+18.03s (+12.96%)156.62s157.71sp=0.005 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols265,866265,866~~~p=1.000 n=6
Types108,401108,401~~~p=1.000 n=6
Memory used410,620k (± 0.02%)410,632k (± 0.02%)~410,518k410,736kp=0.810 n=6
Parse Time4.73s (± 0.82%)4.76s (± 1.23%)~4.71s4.85sp=0.468 n=6
Bind Time2.06s (± 1.18%)2.07s (± 0.79%)~2.05s2.09sp=0.806 n=6
Check Time21.03s (± 0.42%)21.06s (± 0.63%)~20.91s21.29sp=0.630 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time27.83s (± 0.36%)27.89s (± 0.38%)~27.74s28.05sp=0.470 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols524,639524,639~~~p=1.000 n=6
Types178,906178,906~~~p=1.000 n=6
Memory used462,733k (± 0.02%)462,688k (± 0.01%)~462,636k462,723kp=0.471 n=6
Parse Time2.61s (± 0.29%)2.60s (± 0.45%)~2.58s2.61sp=0.383 n=6
Bind Time0.98s (± 0.52%)0.98s (± 0.64%)~0.97s0.99sp=0.386 n=6
Check Time15.31s (± 0.45%)15.37s (± 0.47%)~15.27s15.48sp=0.170 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time18.90s (± 0.40%)18.95s (± 0.36%)~18.85s19.04sp=0.199 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

Developer Information:

Download Benchmarks

@weswigham

Copy link
Copy Markdown
MemberAuthor

Much better, no more check regressions, only emit ones, and those aughta get fixed with proper application of .calculatedFlags during the checker walk (though it's admittedly pretty odd that only some projects with emit show the perf regression - maybe those projects have settings such that they don't really look at NodeCheckFlags?).

@weswigham

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test this faster

@typescript-bot

TypeScript Bot (typescript-bot) commented May 15, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test this faster✅ Started👀 Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Wesley Wigham (@weswigham)
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,155+1 (+ 0.00%)~~p=0.001 n=6
Types50,24850,251+3 (+ 0.01%)~~p=0.001 n=6
Memory used192,255k (± 0.03%)191,841k (± 0.09%)-414k (- 0.22%)191,736k192,184kp=0.008 n=6
Parse Time1.56s (± 1.55%)1.57s (± 1.24%)~1.53s1.58sp=0.186 n=6
Bind Time0.87s (± 0.87%)0.86s (± 0.73%)~0.85s0.87sp=0.081 n=6
Check Time11.31s (± 0.41%)11.33s (± 0.50%)~11.24s11.39sp=0.629 n=6
Emit Time3.15s (± 0.37%)4.04s (± 0.26%)🔻+0.90s (+28.48%)4.03s4.06sp=0.005 n=6
Total Time16.88s (± 0.33%)17.80s (± 0.25%)🔻+0.92s (+ 5.46%)17.74s17.86sp=0.005 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,110944,377+267 (+ 0.03%)~~p=0.001 n=6
Types407,140407,284+144 (+ 0.04%)~~p=0.001 n=6
Memory used1,222,053k (± 0.01%)1,222,445k (± 0.00%)+392k (+ 0.03%)1,222,405k1,222,474kp=0.005 n=6
Parse Time8.06s (± 0.37%)8.11s (± 0.26%)+0.04s (+ 0.54%)8.08s8.13sp=0.019 n=6
Bind Time2.24s (± 0.52%)2.23s (± 0.55%)~2.23s2.26sp=0.389 n=6
Check Time36.52s (± 0.59%)36.51s (± 0.45%)~36.35s36.83sp=1.000 n=6
Emit Time17.51s (± 0.42%)20.36s (± 0.41%)🔻+2.85s (+16.26%)20.25s20.50sp=0.005 n=6
Total Time64.34s (± 0.42%)67.21s (± 0.35%)🔻+2.87s (+ 4.47%)66.99s67.66sp=0.005 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,964,1671,964,167~~~p=1.000 n=6
Types819,279819,279~~~p=1.000 n=6
Memory used1,849,638k (± 0.00%)1,849,675k (± 0.00%)+37k (+ 0.00%)1,849,622k1,849,709kp=0.045 n=6
Parse Time6.77s (± 0.39%)6.77s (± 0.31%)~6.74s6.80sp=0.805 n=6
Bind Time2.29s2.29s (± 0.62%)~2.27s2.31sp=1.000 n=6
Check Time58.88s (± 0.29%)58.69s (± 0.48%)~58.30s59.06sp=0.226 n=6
Emit Time0.14s (± 3.60%)0.14s (± 3.60%)~0.14s0.15sp=1.000 n=6
Total Time68.08s (± 0.26%)67.89s (± 0.42%)~67.49s68.25sp=0.298 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,221,2161,221,413+197 (+ 0.02%)~~p=0.001 n=6
Types259,517259,546+29 (+ 0.01%)~~p=0.001 n=6
Memory used2,388,033k (± 3.26%)2,364,164k (± 2.56%)~2,337,968k2,487,875kp=0.471 n=6
Parse Time6.02s (± 0.48%)5.97s (± 1.19%)~5.85s6.04sp=0.228 n=6
Bind Time2.26s (± 0.61%)2.25s (± 0.78%)~2.22s2.27sp=0.126 n=6
Check Time39.70s (± 0.47%)39.92s (± 0.52%)~39.61s40.12sp=0.093 n=6
Emit Time3.15s (± 1.92%)3.13s (± 2.94%)~3.04s3.24sp=0.810 n=6
Total Time51.15s (± 0.25%)51.27s (± 0.53%)~51.01s51.61sp=0.575 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,221,2161,221,413+197 (+ 0.02%)~~p=0.001 n=6
Types259,517259,546+29 (+ 0.01%)~~p=0.001 n=6
Memory used2,413,884k (± 0.02%)2,415,052k (± 0.02%)+1,168k (+ 0.05%)2,414,104k2,415,414kp=0.020 n=6
Parse Time6.22s (± 1.38%)6.18s (± 0.91%)~6.11s6.27sp=0.470 n=6
Bind Time2.03s (± 0.60%)2.03s (± 0.86%)~2.01s2.06sp=0.627 n=6
Check Time40.23s (± 0.40%)40.34s (± 0.34%)~40.15s40.56sp=0.199 n=6
Emit Time3.18s (± 3.62%)3.10s (± 2.72%)~2.99s3.25sp=0.378 n=6
Total Time51.69s (± 0.54%)51.67s (± 0.37%)~51.43s51.89sp=0.810 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols256,767256,845+78 (+ 0.03%)~~p=0.001 n=6
Types104,587104,616+29 (+ 0.03%)~~p=0.001 n=6
Memory used426,107k (± 0.03%)426,389k (± 0.01%)+282k (+ 0.07%)426,297k426,434kp=0.008 n=6
Parse Time4.18s (± 0.75%)4.17s (± 0.66%)~4.13s4.20sp=0.871 n=6
Bind Time1.62s (± 0.65%)1.61s (± 1.73%)~1.57s1.64sp=1.000 n=6
Check Time22.21s (± 0.34%)22.30s (± 0.45%)~22.19s22.43sp=0.334 n=6
Emit Time1.71s (± 1.67%)1.73s (± 0.94%)~1.71s1.75sp=0.225 n=6
Total Time29.71s (± 0.28%)29.81s (± 0.29%)~29.73s29.92sp=0.148 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,575224,575~~~p=1.000 n=6
Types93,78593,785~~~p=1.000 n=6
Memory used369,905k (± 0.01%)369,934k (± 0.02%)~369,796k370,009kp=0.378 n=6
Parse Time2.83s (± 1.06%)2.84s (± 0.82%)~2.80s2.86sp=0.683 n=6
Bind Time1.59s (± 0.69%)1.58s (± 0.77%)~1.57s1.60sp=0.507 n=6
Check Time15.69s (± 0.38%)15.70s (± 0.13%)~15.68s15.74sp=0.418 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.11s (± 0.32%)20.13s (± 0.16%)~20.10s20.18sp=0.421 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,823,9412,825,923+1,982 (+ 0.07%)~~p=0.001 n=6
Types957,912959,018+1,106 (+ 0.12%)~~p=0.001 n=6
Memory used2,996,271k (± 0.00%)2,996,190k (± 0.00%)-81k (- 0.00%)2,996,136k2,996,267kp=0.020 n=6
Parse Time16.94s (± 0.28%)16.93s (± 0.24%)~16.85s16.97sp=0.628 n=6
Bind Time5.01s (± 0.22%)5.01s (± 0.38%)~4.99s5.04sp=0.933 n=6
Check Time88.96s (± 0.40%)88.54s (± 0.34%)~88.13s88.97sp=0.093 n=6
Emit Time28.65s (± 0.59%)41.55s (± 0.69%)🔻+12.90s (+45.03%)41.12s41.78sp=0.005 n=6
Total Time139.55s (± 0.31%)152.03s (± 0.36%)🔻+12.47s (+ 8.94%)151.34s152.55sp=0.005 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols265,866265,866~~~p=1.000 n=6
Types108,401108,401~~~p=1.000 n=6
Memory used410,525k (± 0.01%)410,503k (± 0.02%)~410,453k410,609kp=0.423 n=6
Parse Time3.84s (± 1.10%)3.82s (± 1.39%)~3.76s3.90sp=0.468 n=6
Bind Time1.66s (± 1.25%)1.66s (± 0.62%)~1.64s1.67sp=0.803 n=6
Check Time16.89s (± 0.35%)16.92s (± 0.34%)~16.86s17.00sp=0.422 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.39s (± 0.24%)22.40s (± 0.28%)~22.30s22.47sp=0.747 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols524,639524,639~~~p=1.000 n=6
Types178,906178,906~~~p=1.000 n=6
Memory used462,713k (± 0.03%)462,728k (± 0.01%)~462,660k462,817kp=0.521 n=6
Parse Time3.89s (± 0.60%)3.88s (± 0.41%)~3.86s3.90sp=0.415 n=6
Bind Time1.45s (± 1.71%)1.44s (± 1.73%)~1.42s1.49sp=0.516 n=6
Check Time22.41s (± 0.75%)22.65s (± 0.47%)+0.25s (+ 1.09%)22.50s22.82sp=0.013 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time27.75s (± 0.50%)27.97s (± 0.36%)+0.22s (+ 0.80%)27.84s28.13sp=0.020 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

Developer Information:

Download Benchmarks

@weswigham

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test this faster

@typescript-bot

TypeScript Bot (typescript-bot) commented May 15, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test this faster✅ Started👀 Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Wesley Wigham (@weswigham)
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,155+1 (+ 0.00%)~~p=0.001 n=6
Types50,24850,251+3 (+ 0.01%)~~p=0.001 n=6
Memory used193,418k (± 0.97%)193,538k (± 0.98%)~191,747k195,341kp=0.378 n=6
Parse Time1.29s (± 1.88%)1.29s (± 1.88%)~1.25s1.31sp=1.000 n=6
Bind Time0.72s0.72s~~~p=1.000 n=6
Check Time9.54s (± 0.19%)9.61s (± 0.24%)+0.07s (+ 0.72%)9.58s9.64sp=0.005 n=6
Emit Time2.65s (± 0.66%)3.39s (± 0.97%)🔻+0.74s (+28.09%)3.33s3.43sp=0.005 n=6
Total Time14.20s (± 0.21%)15.01s (± 0.41%)🔻+0.81s (+ 5.72%)14.90s15.07sp=0.005 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,110944,377+267 (+ 0.03%)~~p=0.001 n=6
Types407,140407,284+144 (+ 0.04%)~~p=0.001 n=6
Memory used1,222,132k (± 0.01%)1,222,504k (± 0.01%)+372k (+ 0.03%)1,222,362k1,222,581kp=0.005 n=6
Parse Time6.79s (± 0.50%)6.78s (± 0.54%)~6.74s6.83sp=1.000 n=6
Bind Time1.88s (± 0.56%)1.87s (± 0.48%)~1.86s1.88sp=0.452 n=6
Check Time31.32s (± 0.33%)31.32s (± 0.50%)~31.07s31.46sp=1.000 n=6
Emit Time14.74s (± 0.65%)17.24s (± 0.76%)🔻+2.50s (+16.96%)17.10s17.43sp=0.005 n=6
Total Time54.73s (± 0.25%)57.22s (± 0.42%)🔻+2.49s (+ 4.56%)56.82s57.50sp=0.005 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,964,1761,964,176~~~p=1.000 n=6
Types819,283819,283~~~p=1.000 n=6
Memory used1,849,541k (± 0.00%)1,849,717k (± 0.00%)+176k (+ 0.01%)1,849,696k1,849,745kp=0.005 n=6
Parse Time8.03s (± 0.19%)8.04s (± 0.38%)~8.01s8.10sp=0.805 n=6
Bind Time2.74s (± 1.34%)2.73s (± 0.77%)~2.71s2.76sp=0.807 n=6
Check Time69.29s (± 0.43%)69.52s (± 0.37%)~69.17s69.78sp=0.378 n=6
Emit Time0.17s (± 3.10%)0.17s (± 2.42%)~0.16s0.17sp=0.595 n=6
Total Time80.23s (± 0.39%)80.46s (± 0.36%)~80.08s80.74sp=0.423 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,221,2211,221,418+197 (+ 0.02%)~~p=0.001 n=6
Types259,523259,552+29 (+ 0.01%)~~p=0.001 n=6
Memory used2,337,909k (± 0.02%)2,363,689k (± 2.61%)~2,337,890k2,489,811kp=0.066 n=6
Parse Time5.05s (± 0.93%)5.02s (± 1.36%)~4.95s5.12sp=0.230 n=6
Bind Time1.88s (± 0.64%)1.88s (± 0.89%)~1.85s1.90sp=0.360 n=6
Check Time33.87s (± 0.34%)33.92s (± 0.31%)~33.81s34.06sp=0.575 n=6
Emit Time2.63s (± 1.38%)2.66s (± 2.63%)~2.58s2.76sp=0.470 n=6
Total Time43.42s (± 0.30%)43.50s (± 0.41%)~43.28s43.79sp=0.423 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,221,2211,221,418+197 (+ 0.02%)~~p=0.001 n=6
Types259,523259,552+29 (+ 0.01%)~~p=0.001 n=6
Memory used2,414,128k (± 0.01%)2,414,654k (± 0.04%)~2,413,128k2,415,607kp=0.230 n=6
Parse Time6.20s (± 0.64%)6.16s (± 0.97%)~6.09s6.26sp=0.173 n=6
Bind Time2.02s (± 1.07%)2.03s (± 1.47%)~2.00s2.07sp=0.687 n=6
Check Time40.12s (± 0.30%)40.29s (± 0.27%)+0.17s (+ 0.43%)40.15s40.40sp=0.031 n=6
Emit Time3.10s (± 2.29%)3.11s (± 2.71%)~3.02s3.22sp=0.748 n=6
Total Time51.45s (± 0.34%)51.60s (± 0.29%)~51.36s51.80sp=0.230 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols256,767256,845+78 (+ 0.03%)~~p=0.001 n=6
Types104,587104,616+29 (+ 0.03%)~~p=0.001 n=6
Memory used426,103k (± 0.03%)426,358k (± 0.01%)+255k (+ 0.06%)426,325k426,383kp=0.005 n=6
Parse Time2.79s (± 0.30%)2.78s (± 0.73%)~2.75s2.81sp=0.171 n=6
Bind Time1.10s (± 1.06%)1.11s+0.01s (+ 1.06%)~~p=0.028 n=6
Check Time15.19s (± 0.27%)15.30s (± 0.35%)+0.11s (+ 0.70%)15.24s15.40sp=0.006 n=6
Emit Time1.16s (± 0.44%)1.14s (± 0.71%)-0.02s (- 1.72%)1.13s1.15sp=0.004 n=6
Total Time20.25s (± 0.23%)20.34s (± 0.18%)+0.09s (+ 0.43%)20.29s20.40sp=0.010 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,575224,575~~~p=1.000 n=6
Types93,78593,785~~~p=1.000 n=6
Memory used369,831k (± 0.03%)369,849k (± 0.04%)~369,714k370,098kp=1.000 n=6
Parse Time3.52s (± 1.01%)3.50s (± 1.02%)~3.45s3.55sp=0.518 n=6
Bind Time1.93s (± 0.85%)1.93s (± 1.24%)~1.89s1.96sp=1.000 n=6
Check Time19.32s (± 0.30%)19.34s (± 0.32%)~19.26s19.43sp=0.747 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time24.77s (± 0.23%)24.77s (± 0.25%)~24.70s24.87sp=0.630 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,823,9412,825,923+1,982 (+ 0.07%)~~p=0.001 n=6
Types957,912959,018+1,106 (+ 0.12%)~~p=0.001 n=6
Memory used2,996,264k (± 0.00%)2,996,204k (± 0.00%)~2,996,140k2,996,288kp=0.065 n=6
Parse Time16.96s (± 0.22%)16.94s (± 0.32%)~16.87s17.03sp=0.226 n=6
Bind Time5.00s (± 0.23%)5.00s (± 0.21%)~4.99s5.02sp=0.615 n=6
Check Time88.52s (± 0.15%)88.43s (± 0.16%)~88.24s88.61sp=0.261 n=6
Emit Time28.75s (± 1.17%)41.63s (± 0.31%)🔻+12.88s (+44.80%)41.47s41.81sp=0.005 n=6
Total Time139.23s (± 0.31%)152.00s (± 0.14%)🔻+12.78s (+ 9.18%)151.66s152.31sp=0.005 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols265,866265,866~~~p=1.000 n=6
Types108,401108,401~~~p=1.000 n=6
Memory used410,600k (± 0.03%)410,485k (± 0.01%)-115k (- 0.03%)410,443k410,539kp=0.031 n=6
Parse Time3.85s (± 0.93%)3.85s (± 0.65%)~3.80s3.87sp=0.806 n=6
Bind Time1.67s (± 0.33%)1.67s (± 1.35%)~1.63s1.70sp=0.663 n=6
Check Time17.02s (± 0.32%)16.92s (± 0.26%)-0.10s (- 0.59%)16.86s16.98sp=0.013 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.53s (± 0.13%)22.44s (± 0.20%)-0.09s (- 0.41%)22.38s22.49sp=0.008 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols524,639524,639~~~p=1.000 n=6
Types178,906178,906~~~p=1.000 n=6
Memory used462,686k (± 0.01%)462,738k (± 0.02%)~462,665k462,889kp=0.128 n=6
Parse Time3.11s (± 0.52%)3.11s (± 0.47%)~3.09s3.13sp=0.870 n=6
Bind Time1.16s (± 0.72%)1.17s (± 0.44%)~1.16s1.17sp=0.533 n=6
Check Time18.31s (± 0.39%)18.42s (± 0.51%)+0.11s (+ 0.62%)18.31s18.56sp=0.045 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.59s (± 0.26%)22.70s (± 0.45%)~22.56s22.85sp=0.054 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

Developer Information:

Download Benchmarks

Comment threadsrc/compiler/types.ts
isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
hasNodeCheckFlag(node: Node, flags: LazyNodeCheckFlags): boolean;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All in all, I wonder how many other flag checks could be done like this (I did something similar for another flag which helped perf too)

@jakebailey

Copy link
Copy Markdown
Member

For fun

TypeScript Bot (@typescript-bot) perf test this predictable

@typescript-bot

TypeScript Bot (typescript-bot) commented May 16, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test this predictable✅ 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,24850,248~~~p=1.000 n=6
Memory used192,229k192,251k+22k (+ 0.01%)~~p=0.001 n=6
Parse Time1.55s (± 0.26%)1.55s (± 0.49%)~1.54s1.56sp=1.000 n=6
Bind Time0.85s (± 0.60%)0.85s (± 0.60%)~0.85s0.86sp=1.000 n=6
Check Time11.10s (± 0.17%)11.04s (± 0.08%)-0.06s (- 0.50%)11.03s11.05sp=0.005 n=6
Emit Time3.38s (± 0.15%)3.52s (± 0.12%)🔻+0.14s (+ 4.09%)3.52s3.53sp=0.003 n=6
Total Time16.88s (± 0.09%)16.96s (± 0.07%)+0.09s (+ 0.51%)16.95s16.98sp=0.005 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,110944,114+4 (+ 0.00%)~~p=0.001 n=6
Types407,140407,157+17 (+ 0.00%)~~p=0.001 n=6
Memory used1,222,410k (± 0.00%)1,222,489k (± 0.00%)+79k (+ 0.01%)1,222,377k1,222,540kp=0.043 n=6
Parse Time6.44s (± 0.15%)6.44s (± 0.10%)~6.43s6.45sp=0.733 n=6
Bind Time1.87s1.87s (± 0.28%)~1.87s1.88sp=0.174 n=6
Check Time33.39s (± 0.08%)35.10s (± 3.14%)🔻+1.71s (+ 5.12%)33.66s35.88sp=0.005 n=6
Emit Time16.29s (± 0.75%)15.60s (± 6.29%)~14.95s16.87sp=0.376 n=6
Total Time57.99s (± 0.22%)59.02s (± 0.23%)+1.02s (+ 1.76%)58.85s59.19sp=0.005 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,964,1881,964,188~~~p=1.000 n=6
Types819,291819,291~~~p=1.000 n=6
Memory used1,849,834k (± 0.00%)1,849,846k (± 0.01%)~1,849,614k1,850,270kp=0.687 n=6
Parse Time10.01s (± 0.14%)10.01s (± 0.15%)~10.00s10.04sp=0.243 n=6
Bind Time2.71s (± 0.20%)2.71s~~~p=0.071 n=6
Check Time90.75s (± 0.11%)92.96s (± 1.55%)~90.49s94.21sp=0.065 n=6
Emit Time0.21s (± 5.69%)0.33s (±53.32%)~0.21s0.56sp=0.209 n=6
Total Time103.68s (± 0.09%)106.02s (± 1.33%)~103.42s107.14sp=0.066 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,221,2311,221,427+196 (+ 0.02%)~~p=0.001 n=6
Types259,523259,552+29 (+ 0.01%)~~p=0.001 n=6
Memory used2,339,017k (± 0.00%)2,339,875k (± 0.00%)+858k (+ 0.04%)2,339,829k2,340,029kp=0.004 n=6
Parse Time6.96s (± 0.07%)6.95s (± 0.08%)~6.95s6.96sp=0.640 n=6
Bind Time2.58s2.59s (± 0.47%)~2.58s2.61sp=0.176 n=6
Check Time49.70s (± 0.10%)49.86s (± 0.11%)+0.16s (+ 0.32%)49.81s49.95sp=0.005 n=6
Emit Time4.25s (± 0.19%)4.25s (± 0.25%)~4.24s4.27sp=0.510 n=6
Total Time63.49s (± 0.06%)63.67s (± 0.11%)+0.18s (+ 0.28%)63.60s63.77sp=0.005 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,221,2311,221,427+196 (+ 0.02%)~~p=0.001 n=6
Types259,523259,552+29 (+ 0.01%)~~p=0.001 n=6
Memory used2,413,286k (± 0.00%)2,414,448k (± 0.00%)+1,162k (+ 0.05%)2,414,337k2,414,470kp=0.003 n=6
Parse Time7.22s (± 0.25%)7.21s (± 0.25%)~7.19s7.24sp=0.624 n=6
Bind Time2.51s2.53s+0.02s (+ 0.80%)~~p=0.001 n=6
Check Time49.81s (± 0.09%)50.08s (± 0.05%)+0.27s (+ 0.55%)50.04s50.12sp=0.005 n=6
Emit Time4.29s (± 0.12%)4.24s (± 0.53%)-0.04s (- 0.97%)4.23s4.29sp=0.023 n=6
Total Time63.81s (± 0.08%)64.05s (± 0.04%)+0.24s (+ 0.38%)64.03s64.09sp=0.005 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols256,768256,845+77 (+ 0.03%)~~p=0.001 n=6
Types104,587104,616+29 (+ 0.03%)~~p=0.001 n=6
Memory used425,968k426,271k+303k (+ 0.07%)~~p=0.001 n=6
Parse Time3.12s (± 0.33%)3.12s (± 0.29%)~3.11s3.13sp=0.673 n=6
Bind Time1.57s1.57s~~~p=1.000 n=6
Check Time17.91s (± 0.18%)17.89s (± 0.13%)~17.87s17.92sp=0.191 n=6
Emit Time1.37s1.37s (± 0.30%)~1.37s1.38sp=0.405 n=6
Total Time23.97s (± 0.16%)23.95s (± 0.10%)~23.93s23.99sp=0.625 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,575224,575~~~p=1.000 n=6
Types93,78593,785~~~p=1.000 n=6
Memory used369,734k369,760k+26k (+ 0.01%)~~p=0.001 n=6
Parse Time2.81s (± 0.52%)2.81s (± 0.29%)~2.80s2.82sp=0.508 n=6
Bind Time1.42s (± 0.29%)1.42s~~~p=0.405 n=6
Check Time15.92s (± 0.08%)16.04s (± 0.27%)+0.12s (+ 0.74%)16.00s16.12sp=0.005 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.15s (± 0.12%)20.27s (± 0.17%)+0.12s (+ 0.61%)20.25s20.34sp=0.005 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,824,6342,824,662+28 (+ 0.00%)~~p=0.001 n=6
Types958,192958,235+43 (+ 0.00%)~~p=0.001 n=6
Memory used3,000,142k3,000,070k-72k (- 0.00%)~~p=0.001 n=6
Parse Time14.49s (± 0.12%)14.48s (± 0.16%)~14.46s14.51sp=0.328 n=6
Bind Time4.29s (± 0.13%)4.28s (± 0.10%)-0.02s (- 0.39%)4.27s4.28sp=0.003 n=6
Check Time75.50s (± 0.09%)76.02s (± 0.14%)+0.52s (+ 0.68%)75.87s76.13sp=0.005 n=6
Emit Time20.11s (± 0.10%)20.91s (± 0.43%)🔻+0.81s (+ 4.00%)20.85s21.09sp=0.005 n=6
Total Time114.40s (± 0.05%)115.69s (± 0.08%)+1.30s (+ 1.13%)115.57s115.79sp=0.005 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols265,866265,866~~~p=1.000 n=6
Types108,401108,401~~~p=1.000 n=6
Memory used410,531k410,541k+10k (+ 0.00%)~~p=0.001 n=6
Parse Time3.84s (± 0.35%)3.84s (± 0.32%)~3.82s3.85sp=0.564 n=6
Bind Time1.71s (± 0.30%)1.72s+0.01s (+ 0.39%)~~p=0.025 n=6
Check Time16.81s (± 0.06%)16.84s (± 0.07%)+0.02s (+ 0.14%)16.82s16.85sp=0.014 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.37s (± 0.07%)22.39s (± 0.07%)~22.37s22.41sp=0.062 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols524,639524,639~~~p=1.000 n=6
Types178,906178,906~~~p=1.000 n=6
Memory used462,635k462,670k+35k (+ 0.01%)~~p=0.001 n=6
Parse Time2.54s2.54s (± 0.20%)~2.54s2.55sp=0.174 n=6
Bind Time1.17s (± 0.44%)1.17s (± 0.35%)~1.16s1.17sp=0.595 n=6
Check Time15.33s (± 0.07%)15.41s (± 0.09%)+0.08s (+ 0.51%)15.39s15.43sp=0.004 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time19.04s (± 0.04%)19.11s (± 0.04%)+0.08s (+ 0.42%)19.11s19.13sp=0.004 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,342ms (± 0.26%)2,344ms (± 0.20%)~2,336ms2,349msp=0.629 n=6
Req 2 - geterr5,100ms (± 0.09%)5,120ms (± 0.09%)+20ms (+ 0.39%)5,114ms5,127msp=0.005 n=6
Req 3 - references282ms (± 0.73%)283ms (± 0.53%)~280ms284msp=0.345 n=6
Req 4 - navto226ms (± 0.98%)226ms (± 0.72%)~225ms229msp=1.000 n=6
Req 5 - completionInfo count1,3571,357~~~p=1.000 n=6
Req 5 - completionInfo89ms (± 6.28%)91ms (± 4.86%)~82ms93msp=0.149 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen3,028ms (± 0.43%)3,035ms (± 0.28%)~3,024ms3,048msp=0.378 n=6
Req 2 - geterr4,786ms (± 9.50%)4,625ms (± 0.17%)~4,614ms4,632msp=0.128 n=6
Req 3 - references388ms (±10.88%)374ms (± 8.80%)~359ms441msp=0.803 n=6
Req 4 - navto308ms (±10.55%)298ms (±10.34%)~278ms338msp=1.000 n=6
Req 5 - completionInfo count1,5191,519~~~p=1.000 n=6
Req 5 - completionInfo111ms (±11.39%)107ms (±11.12%)~99ms122msp=0.640 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen5,319ms (± 0.09%)5,317ms (± 0.13%)~5,306ms5,324msp=0.809 n=6
Req 2 - geterr1,140ms (± 0.15%)1,138ms (± 0.12%)~1,136ms1,140msp=0.191 n=6
Req 3 - references84ms (± 0.62%)88ms🔻+4ms (+ 5.18%)~~p=0.002 n=6
Req 4 - navto449ms (± 0.19%)447ms (± 0.09%)-1ms (- 0.30%)447ms448msp=0.007 n=6
Req 5 - completionInfo count3,4133,413~~~p=1.000 n=6
Req 5 - completionInfo821ms (± 0.10%)836ms (± 0.09%)+15ms (+ 1.87%)835ms837msp=0.004 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 time166.41ms (± 0.10%)168.44ms (± 0.13%)+2.03ms (+ 1.22%)167.49ms173.47msp=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time309.42ms (± 0.27%)309.58ms (± 0.24%)+0.16ms (+ 0.05%)303.31ms315.62msp=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time244.98ms (± 0.09%)246.22ms (± 0.13%)+1.24ms (+ 0.51%)245.31ms253.09msp=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time245.85ms (± 0.12%)246.13ms (± 0.08%)+0.29ms (+ 0.12%)245.19ms247.61msp=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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@jakebailey

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) perf test this predictable

@typescript-bot

TypeScript Bot (typescript-bot) commented May 20, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test this predictable✅ 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,24850,248~~~p=1.000 n=6
Memory used192,230k192,252k+22k (+ 0.01%)~~p=0.001 n=6
Parse Time1.92s (± 0.42%)1.92s (± 0.43%)~1.91s1.93sp=0.718 n=6
Bind Time1.05s (± 0.49%)1.06s (± 0.84%)~1.05s1.07sp=0.190 n=6
Check Time13.74s (± 0.04%)13.73s (± 0.14%)~13.71s13.76sp=0.154 n=6
Emit Time4.21s (± 0.12%)4.37s (± 0.17%)+0.16s (+ 3.84%)4.36s4.38sp=0.004 n=6
Total Time20.92s (± 0.08%)21.08s (± 0.15%)+0.16s (+ 0.75%)21.06s21.14sp=0.005 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,110944,114+4 (+ 0.00%)~~p=0.001 n=6
Types407,140407,157+17 (+ 0.00%)~~p=0.001 n=6
Memory used1,222,304k (± 0.02%)1,222,425k (± 0.01%)~1,222,186k1,222,604kp=0.297 n=6
Parse Time7.70s (± 0.13%)7.69s (± 0.10%)~7.68s7.70sp=0.300 n=6
Bind Time2.24s (± 0.18%)2.24s (± 0.23%)~2.24s2.25sp=0.595 n=6
Check Time39.66s (± 2.13%)40.00s (± 2.78%)~39.25s41.55sp=0.128 n=6
Emit Time18.44s (± 5.46%)19.02s (± 6.09%)~17.77s20.12sp=0.378 n=6
Total Time68.03s (± 1.31%)68.95s (± 0.98%)+0.92s (+ 1.35%)67.60s69.31sp=0.030 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,979,1561,979,156~~~p=1.000 n=6
Types882,049882,049~~~p=1.000 n=6
Memory used1,885,172k (± 0.01%)1,885,324k (± 0.01%)~1,885,214k1,885,545kp=0.093 n=6
Parse Time8.12s (± 0.14%)8.12s (± 0.22%)~8.09s8.14sp=0.402 n=6
Bind Time2.21s2.21s (± 0.18%)~2.21s2.22sp=0.405 n=6
Check Time77.50s (± 2.00%)77.22s (± 1.87%)~76.12s79.24sp=0.936 n=6
Emit Time0.22s (±58.44%)0.17s (± 5.72%)~0.16s0.19sp=0.599 n=6
Total Time88.06s (± 1.84%)87.72s (± 1.66%)~86.60s89.75sp=1.000 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,222,6501,222,846+196 (+ 0.02%)~~p=0.001 n=6
Types259,947259,976+29 (+ 0.01%)~~p=0.001 n=6
Memory used2,339,801k (± 0.00%)2,341,049k (± 0.00%)+1,248k (+ 0.05%)2,341,028k2,341,139kp=0.004 n=6
Parse Time6.95s (± 0.28%)6.97s (± 0.12%)+0.02s (+ 0.36%)6.96s6.98sp=0.026 n=6
Bind Time2.56s (± 0.32%)2.57s (± 0.16%)+0.01s (+ 0.20%)2.56s2.57sp=0.047 n=6
Check Time49.57s (± 0.02%)49.92s (± 0.08%)+0.35s (+ 0.71%)49.88s49.99sp=0.005 n=6
Emit Time4.25s (± 0.18%)4.26s (± 0.10%)+0.01s (+ 0.31%)4.26s4.27sp=0.010 n=6
Total Time63.37s (± 0.02%)63.75s (± 0.07%)+0.38s (+ 0.59%)63.69s63.81sp=0.005 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,222,6501,222,846+196 (+ 0.02%)~~p=0.001 n=6
Types259,947259,976+29 (+ 0.01%)~~p=0.001 n=6
Memory used2,414,188k (± 0.00%)2,415,473k+1,286k (+ 0.05%)~~p=0.003 n=6
Parse Time4.87s (± 0.11%)4.87s (± 0.17%)~4.87s4.89sp=0.752 n=6
Bind Time1.70s (± 0.24%)1.70s~~~p=0.405 n=6
Check Time34.32s (± 0.06%)34.53s (± 0.06%)+0.22s (+ 0.64%)34.51s34.56sp=0.005 n=6
Emit Time2.90s (± 0.70%)2.92s (± 0.14%)~2.92s2.93sp=0.056 n=6
Total Time43.78s (± 0.03%)44.02s (± 0.04%)+0.24s (+ 0.56%)44.00s44.05sp=0.005 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols257,595257,672+77 (+ 0.03%)~~p=0.001 n=6
Types104,862104,891+29 (+ 0.03%)~~p=0.001 n=6
Memory used426,431k426,585k+154k (+ 0.04%)~~p=0.001 n=6
Parse Time3.12s (± 0.39%)3.12s (± 0.31%)~3.11s3.13sp=0.498 n=6
Bind Time1.57s1.55s (± 0.33%)-0.02s (- 1.06%)1.55s1.56sp=0.002 n=6
Check Time17.87s (± 0.05%)17.95s (± 0.05%)+0.07s (+ 0.41%)17.93s17.95sp=0.004 n=6
Emit Time1.37s1.37s~~~p=1.000 n=6
Total Time23.92s (± 0.06%)24.00s (± 0.07%)+0.07s (+ 0.29%)23.97s24.01sp=0.005 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,575224,575~~~p=1.000 n=6
Types93,78593,785~~~p=1.000 n=6
Memory used369,748k369,762k+14k (+ 0.00%)~~p=0.001 n=6
Parse Time2.33s (± 0.17%)2.33s~~~p=0.405 n=6
Bind Time1.18s (± 0.35%)1.18s (± 0.35%)~1.18s1.19sp=1.000 n=6
Check Time13.54s (± 0.10%)13.63s (± 0.31%)+0.09s (+ 0.68%)13.59s13.69sp=0.005 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time17.05s (± 0.07%)17.15s (± 0.24%)+0.10s (+ 0.56%)17.11s17.21sp=0.005 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,825,7222,825,750+28 (+ 0.00%)~~p=0.001 n=6
Types958,536958,579+43 (+ 0.00%)~~p=0.001 n=6
Memory used3,000,779k3,000,741k-38k (- 0.00%)~~p=0.001 n=6
Parse Time12.14s (± 0.11%)12.14s (± 0.23%)~12.12s12.19sp=0.459 n=6
Bind Time3.59s (± 0.14%)3.59s (± 0.11%)~3.59s3.60sp=0.114 n=6
Check Time65.14s (± 0.10%)65.67s (± 0.14%)+0.53s (+ 0.82%)65.52s65.77sp=0.005 n=6
Emit Time16.94s (± 0.09%)17.79s (± 0.24%)🔻+0.85s (+ 5.03%)17.75s17.85sp=0.005 n=6
Total Time97.81s (± 0.08%)99.19s (± 0.12%)+1.38s (+ 1.42%)98.99s99.32sp=0.005 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols265,866265,866~~~p=1.000 n=6
Types108,401108,401~~~p=1.000 n=6
Memory used410,533k410,540k+7k (+ 0.00%)~~p=0.001 n=6
Parse Time3.84s (± 0.20%)3.84s (± 0.35%)~3.82s3.86sp=0.548 n=6
Bind Time1.72s (± 0.30%)1.72s (± 0.24%)~1.71s1.72sp=0.595 n=6
Check Time16.79s (± 0.08%)16.80s (± 0.04%)~16.79s16.81sp=0.137 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.34s (± 0.04%)22.36s (± 0.04%)+0.02s (+ 0.07%)22.35s22.37sp=0.015 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols524,654524,654~~~p=1.000 n=6
Types178,920178,920~~~p=1.000 n=6
Memory used462,627k462,661k+34k (+ 0.01%)~~p=0.001 n=6
Parse Time3.78s (± 0.24%)3.78s (± 0.36%)~3.77s3.80sp=0.803 n=6
Bind Time1.72s1.72s~~~p=1.000 n=6
Check Time22.32s (± 0.05%)22.41s (± 0.07%)+0.09s (+ 0.39%)22.39s22.43sp=0.005 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time27.82s (± 0.05%)27.91s (± 0.08%)+0.09s (+ 0.32%)27.88s27.95sp=0.005 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,490ms (± 0.33%)3,387ms (± 8.01%)~2,833ms3,521msp=1.000 n=6
Req 2 - geterr7,550ms (± 0.27%)7,321ms (± 8.02%)~6,122ms7,577msp=0.748 n=6
Req 3 - references415ms (± 0.20%)418ms (± 0.60%)+3ms (+ 0.72%)416ms422msp=0.011 n=6
Req 4 - navto340ms (± 0.48%)340ms (± 0.81%)~336ms342msp=0.849 n=6
Req 5 - completionInfo count1,3571,357~~~p=1.000 n=6
Req 5 - completionInfo124ms (± 5.07%)127ms (± 6.41%)~121ms138msp=0.437 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen3,030ms (± 0.34%)3,019ms (± 0.47%)~3,004ms3,034msp=0.378 n=6
Req 2 - geterr5,155ms (±11.64%)4,617ms (± 0.19%)~4,609ms4,634msp=0.470 n=6
Req 3 - references416ms (±10.20%)388ms (±10.87%)~360ms443msp=0.128 n=6
Req 4 - navto312ms (± 8.76%)315ms (± 9.36%)~278ms339msp=0.622 n=6
Req 5 - completionInfo count1,5191,519~~~p=1.000 n=6
Req 5 - completionInfo111ms (±11.39%)114ms (±10.29%)~99ms122msp=0.859 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen7,230ms (±10.08%)6,485ms (± 4.91%)🟩-745ms (-10.30%)6,343ms7,136msp=0.045 n=6
Req 2 - geterr1,584ms (±10.65%)1,418ms (± 9.44%)🟩-166ms (-10.47%)1,359ms1,691msp=0.044 n=6
Req 3 - references124ms (± 7.89%)126ms (±10.36%)~109ms135msp=0.209 n=6
Req 4 - navto671ms (± 0.12%)653ms (± 7.50%)~553ms675msp=0.373 n=6
Req 5 - completionInfo count3,4133,413~~~p=1.000 n=6
Req 5 - completionInfo1,221ms (± 0.17%)1,206ms (± 8.00%)~1,009ms1,250msp=0.063 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 time165.43ms (± 0.10%)167.45ms (± 0.13%)+2.01ms (+ 1.22%)166.79ms172.88msp=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time307.63ms (± 0.12%)307.64ms (± 0.08%)~304.94ms309.89msp=0.693 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time296.91ms (± 0.26%)298.42ms (± 0.31%)+1.51ms (+ 0.51%)291.62ms320.74msp=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time300.23ms (± 0.26%)300.41ms (± 0.27%)+0.18ms (+ 0.06%)293.69ms309.01msp=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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@jakebailey

Copy link
Copy Markdown
Member

The perf results are still seemingly showing a regression in emit time on various projects. Not sure what's going on there but I'll try and profile...

@weswigham

Copy link
Copy Markdown
MemberAuthor

I mentioned it in our meeting, but the only things not noCheck-flagged (aside from change the format of the API function from "get flags" to "has flag") at this point are this range and this range, each of which solve a bug that only crops up when you do out of order checking (namely: cjs merge symbols not manifesting early enough and type only imports not being marked). You could noCheck-flag both of them if you really wanted, but I feel like it'd make using those API methods a bit footgun-y. But if one of them has outsized (though not that outsized) performance impact, I suppose we have little choice?

}

function markLinkedReferences(file: SourceFile) {
ts.forEachChildRecursively(file, n => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can this instead check if file doesnt have TypeChecked flag and do this work and then we can get rid of getDiagnostics all together from getEmitResolver()

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Not quite - the TypeChecked flag is, ironically, set on files whose type checking is skipped. Maybe it's a misnomer, but it really just means "Has checkSourceFile been called on this node?". I get your drift though and, yeah, we could probably do a bit of refactoring to use a node flag to track the diagnostic walk state of the containing file. I'll probably put that up as a separate cleanup, though. I also think I want to move around/refactor the API logic for collectLinkedAliases so the API is harder to misuse, and will probably change markLinkedReferences to match, so I'll put all those nonfunctional changes in a separate PR (which should have a 0-test diff).

Comment threadtests/baselines/reference/autoAccessor3(target=es5).js
@jakebailey

Copy link
Copy Markdown
Member

I'm having a pretty hard time figuring out where the slowdown is; the vscode benchmark takes a long time so two runs are just not comparable, even in predictable mode on a perf locked core.

TypeScript Bot (@typescript-bot) perf test this faster

@typescript-bot

TypeScript Bot (typescript-bot) commented May 24, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test this faster✅ 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,24850,248~~~p=1.000 n=6
Memory used192,872k (± 0.79%)192,460k (± 0.14%)~192,227k192,869kp=0.298 n=6
Parse Time1.54s (± 1.90%)1.56s (± 0.94%)~1.54s1.58sp=0.292 n=6
Bind Time0.87s (± 0.63%)0.87s (± 1.21%)~0.85s0.88sp=1.000 n=6
Check Time11.30s (± 0.41%)11.35s (± 0.37%)~11.29s11.40sp=0.106 n=6
Emit Time3.15s (± 0.67%)3.28s (± 1.10%)🔻+0.13s (+ 4.18%)3.25s3.34sp=0.005 n=6
Total Time16.86s (± 0.29%)17.05s (± 0.21%)+0.19s (+ 1.14%)17.01s17.10sp=0.005 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,110944,114+4 (+ 0.00%)~~p=0.001 n=6
Types407,140407,157+17 (+ 0.00%)~~p=0.001 n=6
Memory used1,222,082k (± 0.00%)1,222,179k (± 0.00%)+97k (+ 0.01%)1,222,119k1,222,271kp=0.008 n=6
Parse Time6.79s (± 0.37%)6.74s (± 0.57%)~6.71s6.80sp=0.052 n=6
Bind Time1.88s (± 0.73%)1.87s (± 0.44%)~1.87s1.89sp=1.000 n=6
Check Time31.40s (± 0.40%)31.31s (± 0.22%)~31.26s31.45sp=0.147 n=6
Emit Time14.85s (± 1.05%)15.28s (± 0.47%)+0.42s (+ 2.86%)15.21s15.38sp=0.005 n=6
Total Time54.91s (± 0.42%)55.20s (± 0.23%)+0.29s (+ 0.52%)55.05s55.38sp=0.045 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,982,4931,982,493~~~p=1.000 n=6
Types882,095882,095~~~p=1.000 n=6
Memory used1,886,152k (± 0.00%)1,886,171k (± 0.00%)~1,886,139k1,886,233kp=0.471 n=6
Parse Time6.79s (± 0.37%)6.80s (± 0.39%)~6.76s6.83sp=0.809 n=6
Bind Time2.30s (± 0.84%)2.32s (± 1.35%)~2.28s2.36sp=0.292 n=6
Check Time60.82s (± 0.51%)60.45s (± 0.54%)~60.06s60.85sp=0.173 n=6
Emit Time0.14s (± 2.88%)0.14s~~~p=0.405 n=6
Total Time70.05s (± 0.46%)69.71s (± 0.50%)~69.25s70.15sp=0.230 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,225,0031,225,199+196 (+ 0.02%)~~p=0.001 n=6
Types260,663260,692+29 (+ 0.01%)~~p=0.001 n=6
Memory used2,341,920k (± 0.05%)2,342,420k (± 0.04%)~2,341,598k2,344,070kp=0.471 n=6
Parse Time4.95s (± 0.76%)4.97s (± 0.53%)~4.94s5.00sp=0.173 n=6
Bind Time1.91s (± 0.43%)1.90s (± 0.54%)~1.89s1.92sp=0.546 n=6
Check Time33.84s (± 0.36%)33.96s (± 0.33%)~33.81s34.11sp=0.148 n=6
Emit Time2.63s (± 1.51%)2.69s (± 2.22%)~2.58s2.74sp=0.092 n=6
Total Time43.35s (± 0.25%)43.53s (± 0.39%)~43.31s43.73sp=0.128 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,225,0031,225,199+196 (+ 0.02%)~~p=0.001 n=6
Types260,663260,692+29 (+ 0.01%)~~p=0.001 n=6
Memory used2,443,367k (± 2.52%)2,443,368k (± 2.54%)~2,417,448k2,570,158kp=0.810 n=6
Parse Time5.18s (± 1.19%)5.19s (± 0.50%)~5.16s5.23sp=0.810 n=6
Bind Time1.69s (± 0.45%)1.69s (± 0.37%)~1.68s1.70sp=0.718 n=6
Check Time34.32s (± 0.37%)34.32s (± 0.32%)~34.15s34.43sp=1.000 n=6
Emit Time2.65s (± 2.24%)2.71s (± 1.81%)~2.62s2.77sp=0.126 n=6
Total Time43.87s (± 0.27%)43.95s (± 0.29%)~43.74s44.09sp=0.378 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols257,738257,815+77 (+ 0.03%)~~p=0.001 n=6
Types104,935104,964+29 (+ 0.03%)~~p=0.001 n=6
Memory used426,724k (± 0.03%)427,059k (± 0.01%)+335k (+ 0.08%)427,010k427,128kp=0.005 n=6
Parse Time3.38s (± 0.81%)3.33s (± 0.59%)-0.05s (- 1.38%)3.31s3.36sp=0.019 n=6
Bind Time1.32s (± 0.62%)1.33s (± 1.11%)~1.30s1.34sp=0.230 n=6
Check Time18.03s (± 0.25%)18.00s (± 0.19%)~17.95s18.04sp=0.335 n=6
Emit Time1.33s (± 0.88%)1.33s (± 1.10%)~1.31s1.35sp=1.000 n=6
Total Time24.06s (± 0.22%)23.99s (± 0.19%)~23.91s24.03sp=0.065 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,575224,575~~~p=1.000 n=6
Types93,78593,785~~~p=1.000 n=6
Memory used369,809k (± 0.02%)369,964k (± 0.02%)+155k (+ 0.04%)369,855k370,064kp=0.031 n=6
Parse Time2.85s (± 0.53%)2.83s (± 0.85%)~2.79s2.85sp=0.141 n=6
Bind Time1.58s (± 0.96%)1.59s (± 0.87%)~1.57s1.60sp=1.000 n=6
Check Time15.68s (± 0.61%)15.74s (± 0.23%)~15.69s15.77sp=0.064 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.11s (± 0.57%)20.15s (± 0.23%)~20.10s20.21sp=0.228 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,836,2882,836,288~~~p=1.000 n=6
Types961,202961,202~~~p=1.000 n=6
Memory used3,008,664k (± 0.00%)3,008,698k (± 0.00%)~3,008,675k3,008,723kp=0.230 n=6
Parse Time17.06s (± 0.39%)17.00s (± 0.20%)-0.07s (- 0.39%)16.96s17.06sp=0.029 n=6
Bind Time5.06s (± 0.36%)5.08s (± 0.82%)~5.05s5.16sp=0.357 n=6
Check Time89.11s (± 0.25%)90.75s (± 2.67%)~88.96s94.10sp=0.378 n=6
Emit Time28.66s (± 0.53%)27.15s (± 8.87%)~24.04s28.95sp=0.575 n=6
Total Time139.88s (± 0.17%)139.97s (± 0.18%)~139.56s140.19sp=0.575 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols266,087266,087~~~p=1.000 n=6
Types108,518108,518~~~p=1.000 n=6
Memory used410,898k (± 0.02%)410,869k (± 0.01%)~410,836k410,894kp=0.687 n=6
Parse Time4.78s (± 0.43%)4.75s (± 0.85%)~4.69s4.81sp=0.077 n=6
Bind Time2.07s (± 1.12%)2.07s (± 0.95%)~2.04s2.09sp=0.746 n=6
Check Time21.04s (± 0.43%)21.02s (± 0.35%)~20.91s21.10sp=0.573 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time27.90s (± 0.35%)27.83s (± 0.31%)~27.73s27.98sp=0.226 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols535,745535,745~~~p=1.000 n=6
Types182,753182,753~~~p=1.000 n=6
Memory used470,423k (± 0.01%)470,432k (± 0.01%)~470,360k470,525kp=0.689 n=6
Parse Time3.96s (± 0.39%)3.95s (± 0.50%)~3.92s3.97sp=0.460 n=6
Bind Time1.48s (± 0.70%)1.50s (± 0.50%)+0.02s (+ 1.24%)1.49s1.51sp=0.017 n=6
Check Time22.59s (± 0.20%)22.67s (± 0.46%)~22.57s22.85sp=0.108 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time28.04s (± 0.21%)28.12s (± 0.41%)~28.01s28.33sp=0.148 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

Developer Information:

Download Benchmarks

return !!(getNodeCheckFlags(node) & flag);
}

function calculateNodeCheckFlagWorker(node: Node, flag: LazyNodeCheckFlags) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a chance for this to go out of sync with other code that sets these flags?

@weswighamWesley Wigham (weswigham)May 24, 2024

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

100% absolutely, but since we run with noCheck and compare the result to a normal emit for every test we have, it's very likely a test will catch it.

@weswighamWesley Wigham (weswigham)May 24, 2024

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I also do reuse the actual flag-setting functions, just not the traversal to reach and invoke them. So the "should this flag be set" logic should be synced, at least.

@DanielRosenwasser

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) pack this

@typescript-bot

TypeScript Bot (typescript-bot) commented May 24, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
pack this✅ Started✅ Results

@typescript-bot

TypeScript Bot (typescript-bot) commented May 24, 2024

Copy link
Copy Markdown
Contributor

Hey Daniel Rosenwasser (@DanielRosenwasser), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/161938/artifacts?artifactName=tgz&fileId=956C1558FE35CE6051E3654C542769EBA2201B7AB43750178EFB74C53E41987602&fileName=/typescript-5.5.0-insiders.20240524.tgz"
}
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.5.0-pr-58364-29".;

@jakebailey

Copy link
Copy Markdown
Member

I thought I'd try this out on a ts-loader project, so tested out pyright's build before and after. Somehow, it's slower? I suppose this doesn't actually use transpileModule since they're using const enums and everything :(

$ hyperfine 'node --max_old_space_size=8192 ./node_modules/webpack-cli/bin/cli.js --mode development'Benchmark 1: node --max_old_space_size=8192 ./node_modules/webpack-cli/bin/cli.js --mode development Time (mean ± σ): 14.899 s ± 0.221 s [User: 22.878 s, System: 1.591 s] Range (min … max): 14.379 s … 15.200 s 10 runs
$ hyperfine 'node --max_old_space_size=8192 ./node_modules/webpack-cli/bin/cli.js --mode development'Benchmark 1: node --max_old_space_size=8192 ./node_modules/webpack-cli/bin/cli.js --mode development Time (mean ± σ): 15.110 s ± 0.164 s [User: 23.219 s, System: 1.541 s] Range (min … max): 14.888 s … 15.395 s 10 runs

@weswigham

Copy link
Copy Markdown
MemberAuthor

I suppose this doesn't actually use transpileModule since they're using const enums and everything :(

Ya, ts-loader only uses transpileModule if you pass transpileOnly.

@jakebailey

Jake Bailey (jakebailey) commented May 30, 2024

Copy link
Copy Markdown
Member

In lieu of real-world benchmarks, I used tinybench and tested this before/after on files of various sizes in our codebase, calling:

ts.transpileModule(input,{
fileName,compilerOptions: {target: ts.ScriptTarget.ESNext,module: ts.ModuleKind.Preserve}},);
Benchmarking src/typescript/typescript.ts (26 lines)...
┌─────────┬───────────────────────┬─────────┬───────────────────┬──────────┬─────────┐
│ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │
├─────────┼───────────────────────┼─────────┼───────────────────┼──────────┼─────────┤
│ 0 │ 'old transpileModule' │ '1,092' │ 914970.5937785943 │ '±1.49%' │ 10930 │
│ 1 │ 'new transpileModule' │ '1,478' │ 676558.4366416298 │ '±1.69%' │ 14781 │
└─────────┴───────────────────────┴─────────┴───────────────────┴──────────┴─────────┘
35.24% faster, 1.35x faster, 26.06% less time than before
Benchmarking src/compiler/path.ts (1017 lines)...
┌─────────┬───────────────────────┬─────────┬────────────────────┬──────────┬─────────┐
│ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │
├─────────┼───────────────────────┼─────────┼────────────────────┼──────────┼─────────┤
│ 0 │ 'old transpileModule' │ '58' │ 17076565.800341412 │ '±1.07%' │ 586 │
│ 1 │ 'new transpileModule' │ '126' │ 7927894.958795462 │ '±1.06%' │ 1262 │
└─────────┴───────────────────────┴─────────┴────────────────────┴──────────┴─────────┘
115.40% faster, 2.15x faster, 53.57% less time than before
Benchmarking src/server/project.ts (3064 lines)...
┌─────────┬───────────────────────┬─────────┬───────────────────┬──────────┬─────────┐
│ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │
├─────────┼───────────────────────┼─────────┼───────────────────┼──────────┼─────────┤
│ 0 │ 'old transpileModule' │ '12' │ 79510811.21428606 │ '±1.14%' │ 126 │
│ 1 │ 'new transpileModule' │ '31' │ 31801029.40000019 │ '±1.19%' │ 315 │
└─────────┴───────────────────────┴─────────┴───────────────────┴──────────┴─────────┘
150.03% faster, 2.50x faster, 60.00% less time than before
Benchmarking src/compiler/emitter.ts (6266 lines)...
┌─────────┬───────────────────────┬─────────┬───────────────────┬──────────┬─────────┐
│ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │
├─────────┼───────────────────────┼─────────┼───────────────────┼──────────┼─────────┤
│ 0 │ 'old transpileModule' │ '7' │ 135490544.418919 │ '±1.00%' │ 74 │
│ 1 │ 'new transpileModule' │ '15' │ 65744860.17647067 │ '±1.03%' │ 153 │
└─────────┴───────────────────────┴─────────┴───────────────────┴──────────┴─────────┘
106.09% faster, 2.06x faster, 51.48% less time than before
Benchmarking src/compiler/checker.ts (51965 lines)...
┌─────────┬───────────────────────┬─────────┬────────────────────┬──────────┬─────────┐
│ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │
├─────────┼───────────────────────┼─────────┼────────────────────┼──────────┼─────────┤
│ 0 │ 'old transpileModule' │ '0' │ 1719514998.7000027 │ '±5.94%' │ 10 │
│ 1 │ 'new transpileModule' │ '1' │ 839784896.9166638 │ '±2.26%' │ 12 │
└─────────┴───────────────────────┴─────────┴────────────────────┴──────────┴─────────┘
104.76% faster, 2.05x faster, 51.16% less time than before

So, for files of a non-trivial size, it sure seems like a good 2x speed boost for transpileModule users.

I have not been able to pin down the perf regression, if there even is one. But I'm pretty sure we should just take this anyhow.

@jakebaileyJake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, though I'm not 100% thrilled with the increase in test time; it looks like it increases CI time from something like 7 minutes to 8.

@weswigham
Wesley Wigham (weswigham) merged commit bbfc1aa into microsoft:mainMay 30, 2024
Jonathan Skeate (skeate) added a commit to skeate/TypeScript that referenced this pull request Jun 1, 2024
* upstream/main: (37 commits)
Added NoTruncation flag to completions (microsoft#58719)
Clone node to remove location even when it has been modified if needed (microsoft#58706)
Properly account for `this` argument in intersection apparent type caching (microsoft#58677)
Fix: Include Values of Script Extensions for Unicode Property Value Expressions in Regular Expressions (microsoft#58615)
In `reScanSlashToken` use `charCodeChecked` not `codePointChecked` (microsoft#58727)
Shorten error spans for errors reported on constructor declarations (microsoft#58061)
Mark file as skips typechecking if it contains ts-nocheck (microsoft#58593)
Fixed an issue with broken `await using` declarations in `for of` loops (microsoft#56466)
Do not expand type references in keyof and index access (microsoft#58715)
Improve the performance of isolatedDeclarations quickfix (microsoft#58722)
Unwrap `NoInfer` types when narrowing (microsoft#58292)
Recover from type reuse errors by falling back to inferred type printing (microsoft#58720)
Fixing self import (microsoft#58718)
Enable JS emit for noCheck and noCheck for transpileModule (microsoft#58364)
Revert PR 55371 (microsoft#58702)
Update dependencies (microsoft#58639)
Fix baselines after PR 58621 (microsoft#58705)
Do not infer `yield*` type from contextual `TReturn` (microsoft#58621)
`await using` normative changes (microsoft#58624)
Handling statements from a known source file (microsoft#58679)
...
@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.

5 participants

@weswigham@typescript-bot@jakebailey@DanielRosenwasser@sheetalkamat