Skip to content

feat(#45195) Improve perf of unions with many primitives - #45220

Merged
Andrew Branch (andrewbranch) merged 1 commit into
microsoft:mainfrom
ypresto:perf-large-primitive-union
Oct 12, 2021
Merged

feat(#45195) Improve perf of unions with many primitives#45220
Andrew Branch (andrewbranch) merged 1 commit into
microsoft:mainfrom
ypresto:perf-large-primitive-union

Conversation

@ypresto

Copy link
Copy Markdown
Contributor

Fixes#45195

@typescript-botTypeScript Bot (typescript-bot) added the For Backlog Bug PRs that fix a backlog bug label Jul 28, 2021
@DanielRosenwasser

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) perf test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 28, 2021

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the perf test suite on this PR at 603f4dc. You can monitor the build here.

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser)
The results of the perf run you requested are in!

Here they are:

Comparison Report - main..45220

Metricmain45220DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used347,541k (± 0.03%)347,324k (± 0.03%)-217k (- 0.06%)347,107k347,492k
Parse Time1.88s (± 0.46%)1.88s (± 0.69%)+0.00s (+ 0.11%)1.86s1.93s
Bind Time0.86s (± 0.52%)0.86s (± 0.46%)+0.00s (+ 0.35%)0.85s0.87s
Check Time5.34s (± 0.39%)5.35s (± 0.62%)+0.01s (+ 0.28%)5.28s5.44s
Emit Time5.82s (± 0.47%)5.83s (± 0.72%)+0.02s (+ 0.28%)5.77s5.94s
Total Time13.89s (± 0.21%)13.93s (± 0.41%)+0.03s (+ 0.24%)13.83s14.05s
Compiler-Unions - node (v10.16.3, x64)
Memory used203,318k (± 0.03%)203,402k (± 0.03%)+85k (+ 0.04%)203,269k203,497k
Parse Time0.79s (± 0.60%)0.79s (± 0.96%)-0.00s (- 0.13%)0.77s0.80s
Bind Time0.53s (± 1.45%)0.52s (± 0.94%)-0.00s (- 0.19%)0.51s0.53s
Check Time7.77s (± 0.42%)7.79s (± 0.56%)+0.02s (+ 0.21%)7.67s7.88s
Emit Time2.44s (± 0.83%)2.43s (± 0.76%)-0.01s (- 0.25%)2.39s2.48s
Total Time11.51s (± 0.40%)11.53s (± 0.26%)+0.01s (+ 0.11%)11.46s11.60s
Monaco - node (v10.16.3, x64)
Memory used340,616k (± 0.04%)340,519k (± 0.02%)-97k (- 0.03%)340,355k340,611k
Parse Time1.47s (± 0.48%)1.45s (± 0.83%)-0.02s (- 1.29%)1.42s1.47s
Bind Time0.74s (± 0.64%)0.75s (± 0.64%)+0.00s (+ 0.54%)0.74s0.76s
Check Time5.41s (± 0.68%)5.39s (± 0.72%)-0.02s (- 0.41%)5.27s5.45s
Emit Time3.16s (± 0.60%)3.18s (± 0.85%)+0.02s (+ 0.63%)3.13s3.24s
Total Time10.78s (± 0.48%)10.76s (± 0.52%)-0.02s (- 0.17%)10.62s10.89s
TFS - node (v10.16.3, x64)
Memory used303,972k (± 0.02%)304,035k (± 0.03%)+64k (+ 0.02%)303,829k304,276k
Parse Time1.18s (± 0.38%)1.18s (± 0.57%)+0.00s (+ 0.17%)1.17s1.20s
Bind Time0.71s (± 1.03%)0.71s (± 1.05%)+0.01s (+ 0.71%)0.70s0.73s
Check Time4.88s (± 0.41%)4.91s (± 0.41%)+0.03s (+ 0.57%)4.88s4.96s
Emit Time3.30s (± 1.31%)3.31s (± 1.54%)+0.02s (+ 0.49%)3.22s3.44s
Total Time10.07s (± 0.46%)10.12s (± 0.54%)+0.05s (+ 0.49%)10.01s10.23s
material-ui - node (v10.16.3, x64)
Memory used469,676k (± 0.01%)468,402k (± 0.02%)-1,274k (- 0.27%)468,232k468,507k
Parse Time1.73s (± 0.50%)1.72s (± 0.29%)-0.00s (- 0.23%)1.71s1.73s
Bind Time0.67s (± 0.55%)0.66s (± 0.51%)-0.00s (- 0.45%)0.66s0.67s
Check Time14.18s (± 0.47%)14.08s (± 0.26%)-0.10s (- 0.71%)14.01s14.18s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time16.58s (± 0.39%)16.47s (± 0.24%)-0.11s (- 0.65%)16.38s16.57s
Angular - node (v12.1.0, x64)
Memory used325,473k (± 0.08%)325,183k (± 0.11%)-289k (- 0.09%)324,205k325,620k
Parse Time1.85s (± 0.48%)1.85s (± 0.63%)-0.00s (- 0.16%)1.82s1.87s
Bind Time0.84s (± 0.35%)0.84s (± 0.66%)-0.00s (- 0.00%)0.83s0.85s
Check Time5.18s (± 0.51%)5.19s (± 0.82%)+0.01s (+ 0.29%)5.14s5.31s
Emit Time6.04s (± 0.43%)6.06s (± 0.87%)+0.02s (+ 0.33%)5.99s6.22s
Total Time13.91s (± 0.34%)13.94s (± 0.62%)+0.03s (+ 0.19%)13.82s14.20s
Compiler-Unions - node (v12.1.0, x64)
Memory used190,627k (± 0.11%)190,704k (± 0.14%)+77k (+ 0.04%)189,993k191,069k
Parse Time0.77s (± 0.77%)0.77s (± 0.84%)-0.00s (- 0.39%)0.76s0.79s
Bind Time0.54s (± 0.92%)0.53s (± 1.09%)-0.00s (- 0.56%)0.52s0.55s
Check Time7.28s (± 0.41%)7.32s (± 0.44%)+0.04s (+ 0.52%)7.24s7.42s
Emit Time2.44s (± 0.66%)2.42s (± 1.10%)-0.02s (- 0.82%)2.39s2.49s
Total Time11.04s (± 0.32%)11.05s (± 0.45%)+0.01s (+ 0.07%)10.94s11.19s
Monaco - node (v12.1.0, x64)
Memory used323,687k (± 0.02%)323,716k (± 0.03%)+29k (+ 0.01%)323,599k323,966k
Parse Time1.42s (± 0.49%)1.43s (± 0.85%)+0.01s (+ 0.49%)1.40s1.46s
Bind Time0.72s (± 1.05%)0.72s (± 0.65%)-0.01s (- 0.69%)0.71s0.73s
Check Time5.23s (± 0.50%)5.24s (± 0.45%)+0.01s (+ 0.19%)5.21s5.31s
Emit Time3.18s (± 1.15%)3.18s (± 0.46%)-0.00s (- 0.06%)3.15s3.22s
Total Time10.55s (± 0.51%)10.57s (± 0.29%)+0.01s (+ 0.12%)10.49s10.64s
TFS - node (v12.1.0, x64)
Memory used288,668k (± 0.02%)288,660k (± 0.01%)-8k (- 0.00%)288,576k288,777k
Parse Time1.20s (± 0.85%)1.20s (± 0.78%)-0.00s (- 0.08%)1.18s1.22s
Bind Time0.70s (± 0.53%)0.70s (± 0.83%)+0.00s (+ 0.29%)0.69s0.71s
Check Time4.84s (± 0.72%)4.83s (± 0.47%)-0.01s (- 0.17%)4.77s4.87s
Emit Time3.37s (± 0.33%)3.36s (± 0.78%)-0.01s (- 0.33%)3.30s3.43s
Total Time10.11s (± 0.34%)10.09s (± 0.40%)-0.02s (- 0.22%)10.00s10.16s
material-ui - node (v12.1.0, x64)
Memory used448,428k (± 0.02%)447,179k (± 0.01%)-1,249k (- 0.28%)447,105k447,286k
Parse Time1.72s (± 0.55%)1.72s (± 0.65%)+0.00s (+ 0.00%)1.69s1.74s
Bind Time0.65s (± 0.92%)0.65s (± 0.69%)+0.00s (+ 0.31%)0.64s0.66s
Check Time12.67s (± 0.45%)12.71s (± 0.60%)+0.04s (+ 0.31%)12.53s12.85s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.04s (± 0.36%)15.07s (± 0.57%)+0.04s (+ 0.26%)14.88s15.24s
Angular - node (v14.15.1, x64)
Memory used324,155k (± 0.01%)323,936k (± 0.01%)-219k (- 0.07%)323,889k323,962k
Parse Time1.87s (± 0.55%)1.87s (± 0.79%)+0.00s (+ 0.21%)1.85s1.92s
Bind Time0.89s (± 0.62%)0.89s (± 0.37%)-0.00s (- 0.22%)0.88s0.90s
Check Time5.21s (± 0.29%)5.20s (± 0.25%)-0.00s (- 0.08%)5.17s5.23s
Emit Time6.12s (± 0.77%)6.15s (± 0.54%)+0.03s (+ 0.54%)6.08s6.24s
Total Time14.09s (± 0.43%)14.11s (± 0.36%)+0.03s (+ 0.20%)14.01s14.26s
Compiler-Unions - node (v14.15.1, x64)
Memory used190,799k (± 0.61%)190,487k (± 0.56%)-312k (- 0.16%)189,504k192,705k
Parse Time0.80s (± 0.37%)0.80s (± 0.72%)+0.00s (+ 0.12%)0.79s0.82s
Bind Time0.56s (± 0.79%)0.56s (± 0.40%)-0.00s (- 0.53%)0.55s0.56s
Check Time7.43s (± 0.45%)7.42s (± 0.54%)-0.00s (- 0.07%)7.36s7.54s
Emit Time2.41s (± 1.39%)2.44s (± 1.46%)+0.02s (+ 0.99%)2.40s2.57s
Total Time11.21s (± 0.39%)11.23s (± 0.51%)+0.02s (+ 0.17%)11.13s11.36s
Monaco - node (v14.15.1, x64)
Memory used322,493k (± 0.00%)322,504k (± 0.00%)+11k (+ 0.00%)322,482k322,543k
Parse Time1.49s (± 0.57%)1.48s (± 0.50%)-0.01s (- 0.54%)1.47s1.50s
Bind Time0.75s (± 0.63%)0.75s (± 0.77%)+0.00s (+ 0.40%)0.74s0.77s
Check Time5.19s (± 0.50%)5.17s (± 0.50%)-0.02s (- 0.39%)5.12s5.21s
Emit Time3.21s (± 0.67%)3.21s (± 0.57%)-0.00s (- 0.12%)3.17s3.25s
Total Time10.65s (± 0.36%)10.62s (± 0.31%)-0.03s (- 0.26%)10.54s10.67s
TFS - node (v14.15.1, x64)
Memory used287,672k (± 0.01%)287,663k (± 0.00%)-9k (- 0.00%)287,638k287,686k
Parse Time1.25s (± 1.26%)1.27s (± 2.11%)+0.02s (+ 1.76%)1.22s1.35s
Bind Time0.72s (± 1.38%)0.73s (± 3.07%)+0.01s (+ 1.24%)0.71s0.82s
Check Time4.83s (± 0.40%)4.85s (± 0.44%)+0.02s (+ 0.41%)4.81s4.91s
Emit Time3.45s (± 0.88%)3.45s (± 0.73%)-0.00s (- 0.09%)3.40s3.51s
Total Time10.25s (± 0.41%)10.30s (± 0.43%)+0.05s (+ 0.48%)10.21s10.41s
material-ui - node (v14.15.1, x64)
Memory used446,836k (± 0.01%)445,489k (± 0.06%)-1,347k (- 0.30%)444,386k445,652k
Parse Time1.75s (± 0.25%)1.75s (± 0.38%)+0.01s (+ 0.29%)1.74s1.77s
Bind Time0.69s (± 0.87%)0.69s (± 0.83%)+0.00s (+ 0.58%)0.68s0.70s
Check Time12.90s (± 1.31%)12.81s (± 0.58%)-0.09s (- 0.73%)12.68s13.05s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.34s (± 1.11%)15.25s (± 0.52%)-0.09s (- 0.57%)15.12s15.52s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-206-generic
Architecturex64
Available Memory16 GB
Available Memory1 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
BenchmarkNameIterations
Current4522010
Baselinemain10

Developer Information:

Download Benchmark

@DanielRosenwasser

Copy link
Copy Markdown
Member

Looks like there's no change in full type-checking time. The change might still be good for end-users though and specifically in editing scenarios.

@amcaseyAndrew Casey (amcasey) 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.

Your investigation was very impressive! Thanks for doing this!

Comment threadsrc/compiler/checker.ts Outdated
@ypresto
Yuya Tanaka (ypresto)force-pushed the perf-large-primitive-union branch 2 times, most recently from 660a061 to b5ca222CompareJuly 29, 2021 13:15
@ypresto

Copy link
Copy Markdown
ContributorAuthor

oops, missing semicolon

@ypresto
Yuya Tanaka (ypresto) marked this pull request as ready for review July 29, 2021 13:40

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.

Thanks for researching this. I think the change can be made shorter, but otherwise it's a good addition.

Comment threadsrc/compiler/checker.ts
@ypresto

Yuya Tanaka (ypresto) commented Oct 12, 2021

Copy link
Copy Markdown
ContributorAuthor

Hello! Please let me know which milestone will this land to, when you know. Thank you. 😀

@DanielRosenwasser

Copy link
Copy Markdown
Member

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

Just to make sure there's been no odd changes in the last few months.

@typescript-bot

TypeScript Bot (typescript-bot) commented Oct 12, 2021

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the perf test suite on this PR at 2d65c9b. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Oct 12, 2021

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the abridged perf test suite on this PR at 2d65c9b. You can monitor the build here.

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser)
The results of the perf run you requested are in!

Here they are:

Comparison Report - main..45220

Metricmain45220DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used354,234k (± 0.02%)354,057k (± 0.02%)-177k (- 0.05%)353,831k354,174k
Parse Time1.94s (± 0.51%)1.95s (± 0.51%)+0.00s (+ 0.26%)1.92s1.97s
Bind Time0.84s (± 0.97%)0.84s (± 0.41%)-0.00s (- 0.36%)0.83s0.84s
Check Time5.44s (± 0.44%)5.46s (± 0.44%)+0.01s (+ 0.26%)5.41s5.52s
Emit Time5.83s (± 0.49%)5.83s (± 0.61%)-0.01s (- 0.10%)5.76s5.91s
Total Time14.05s (± 0.33%)14.07s (± 0.36%)+0.02s (+ 0.11%)13.93s14.18s
Compiler-Unions - node (v10.16.3, x64)
Memory used203,849k (± 0.03%)203,869k (± 0.03%)+20k (+ 0.01%)203,743k203,962k
Parse Time0.79s (± 0.85%)0.79s (± 1.22%)+0.00s (+ 0.25%)0.77s0.82s
Bind Time0.52s (± 1.40%)0.52s (± 1.12%)-0.00s (- 0.19%)0.50s0.53s
Check Time7.89s (± 0.61%)7.92s (± 0.52%)+0.03s (+ 0.38%)7.86s8.05s
Emit Time2.43s (± 0.86%)2.44s (± 0.89%)+0.01s (+ 0.54%)2.40s2.48s
Total Time11.62s (± 0.42%)11.66s (± 0.28%)+0.04s (+ 0.36%)11.61s11.75s
Monaco - node (v10.16.3, x64)
Memory used342,085k (± 0.02%)342,104k (± 0.01%)+18k (+ 0.01%)341,985k342,209k
Parse Time1.48s (± 0.45%)1.49s (± 0.51%)+0.00s (+ 0.13%)1.47s1.50s
Bind Time0.75s (± 0.64%)0.74s (± 0.49%)-0.00s (- 0.40%)0.74s0.75s
Check Time5.45s (± 0.34%)5.43s (± 0.78%)-0.02s (- 0.40%)5.35s5.51s
Emit Time3.17s (± 0.71%)3.18s (± 0.69%)+0.02s (+ 0.51%)3.11s3.22s
Total Time10.84s (± 0.26%)10.84s (± 0.39%)-0.00s (- 0.05%)10.75s10.93s
TFS - node (v10.16.3, x64)
Memory used304,787k (± 0.03%)304,765k (± 0.01%)-23k (- 0.01%)304,649k304,855k
Parse Time1.20s (± 0.39%)1.19s (± 0.50%)-0.00s (- 0.42%)1.18s1.21s
Bind Time0.71s (± 0.87%)0.71s (± 0.56%)-0.00s (- 0.28%)0.70s0.72s
Check Time4.97s (± 0.60%)4.98s (± 0.61%)+0.01s (+ 0.20%)4.92s5.05s
Emit Time3.33s (± 0.99%)3.35s (± 0.86%)+0.02s (+ 0.57%)3.32s3.46s
Total Time10.21s (± 0.50%)10.23s (± 0.38%)+0.02s (+ 0.21%)10.15s10.34s
material-ui - node (v10.16.3, x64)
Memory used472,375k (± 0.01%)471,040k (± 0.01%)-1,335k (- 0.28%)470,919k471,163k
Parse Time1.77s (± 0.50%)1.77s (± 0.65%)-0.00s (- 0.00%)1.75s1.80s
Bind Time0.66s (± 0.72%)0.66s (± 1.17%)+0.00s (+ 0.61%)0.65s0.68s
Check Time14.47s (± 0.38%)14.38s (± 0.44%)-0.09s (- 0.59%)14.24s14.55s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time16.90s (± 0.32%)16.82s (± 0.39%)-0.08s (- 0.47%)16.67s16.97s
Angular - node (v12.1.0, x64)
Memory used332,092k (± 0.02%)331,618k (± 0.13%)-474k (- 0.14%)329,919k332,092k
Parse Time1.93s (± 0.70%)1.93s (± 0.75%)+0.00s (+ 0.05%)1.91s1.98s
Bind Time0.81s (± 0.86%)0.81s (± 1.30%)+0.00s (+ 0.37%)0.80s0.84s
Check Time5.28s (± 0.37%)5.27s (± 1.30%)-0.02s (- 0.34%)5.05s5.45s
Emit Time6.10s (± 0.63%)6.04s (± 1.74%)-0.06s (- 0.93%)5.66s6.22s
Total Time14.12s (± 0.37%)14.05s (± 1.26%)-0.07s (- 0.50%)13.41s14.39s
Compiler-Unions - node (v12.1.0, x64)
Memory used191,395k (± 0.04%)191,348k (± 0.04%)-47k (- 0.02%)191,161k191,520k
Parse Time0.78s (± 0.63%)0.78s (± 0.74%)+0.00s (+ 0.52%)0.77s0.79s
Bind Time0.53s (± 0.84%)0.53s (± 0.63%)+0.00s (+ 0.38%)0.52s0.54s
Check Time7.38s (± 0.57%)7.42s (± 0.58%)+0.04s (+ 0.49%)7.33s7.51s
Emit Time2.47s (± 1.14%)2.46s (± 0.61%)-0.01s (- 0.49%)2.42s2.49s
Total Time11.16s (± 0.52%)11.19s (± 0.34%)+0.03s (+ 0.26%)11.10s11.27s
Monaco - node (v12.1.0, x64)
Memory used325,170k (± 0.02%)325,211k (± 0.02%)+41k (+ 0.01%)325,031k325,365k
Parse Time1.46s (± 0.73%)1.47s (± 0.85%)+0.00s (+ 0.34%)1.44s1.49s
Bind Time0.73s (± 0.82%)0.73s (± 0.64%)+0.00s (+ 0.55%)0.72s0.74s
Check Time5.34s (± 0.61%)5.31s (± 0.61%)-0.03s (- 0.62%)5.24s5.39s
Emit Time3.23s (± 1.27%)3.18s (± 0.75%)-0.04s (- 1.33%)3.12s3.25s
Total Time10.75s (± 0.60%)10.69s (± 0.49%)-0.06s (- 0.60%)10.55s10.77s
TFS - node (v12.1.0, x64)
Memory used289,497k (± 0.02%)289,430k (± 0.02%)-67k (- 0.02%)289,307k289,584k
Parse Time1.21s (± 0.63%)1.21s (± 0.41%)-0.00s (- 0.08%)1.21s1.23s
Bind Time0.69s (± 0.97%)0.69s (± 0.96%)+0.00s (+ 0.44%)0.68s0.71s
Check Time4.90s (± 0.54%)4.89s (± 0.34%)-0.00s (- 0.10%)4.86s4.94s
Emit Time3.37s (± 1.09%)3.37s (± 0.62%)-0.00s (- 0.09%)3.32s3.41s
Total Time10.17s (± 0.49%)10.16s (± 0.32%)-0.01s (- 0.11%)10.07s10.23s
material-ui - node (v12.1.0, x64)
Memory used451,103k (± 0.01%)449,816k (± 0.01%)-1,287k (- 0.29%)449,700k449,941k
Parse Time1.78s (± 0.38%)1.78s (± 0.63%)+0.00s (+ 0.17%)1.76s1.82s
Bind Time0.64s (± 0.91%)0.64s (± 0.81%)+0.00s (+ 0.31%)0.63s0.65s
Check Time12.97s (± 0.45%)12.94s (± 0.46%)-0.04s (- 0.29%)12.74s13.04s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.38s (± 0.39%)15.36s (± 0.40%)-0.03s (- 0.18%)15.15s15.44s
Angular - node (v14.15.1, x64)
Memory used330,486k (± 0.00%)330,251k (± 0.01%)-235k (- 0.07%)330,163k330,297k
Parse Time1.94s (± 0.62%)1.94s (± 0.51%)+0.00s (+ 0.15%)1.93s1.97s
Bind Time0.86s (± 0.40%)0.86s (± 0.72%)+0.00s (+ 0.47%)0.85s0.87s
Check Time5.35s (± 0.33%)5.33s (± 0.34%)-0.03s (- 0.52%)5.28s5.37s
Emit Time6.14s (± 0.47%)6.23s (± 0.67%)+0.09s (+ 1.48%)6.16s6.33s
Total Time14.29s (± 0.34%)14.37s (± 0.34%)+0.07s (+ 0.50%)14.27s14.53s
Compiler-Unions - node (v14.15.1, x64)
Memory used191,817k (± 0.58%)192,868k (± 0.37%)+1,050k (+ 0.55%)190,002k193,293k
Parse Time0.81s (± 0.61%)0.81s (± 0.80%)+0.00s (+ 0.25%)0.80s0.82s
Bind Time0.55s (± 0.40%)0.56s (± 0.80%)+0.01s (+ 1.27%)0.55s0.57s
Check Time7.58s (± 0.54%)7.57s (± 0.43%)-0.02s (- 0.21%)7.50s7.66s
Emit Time2.45s (± 1.20%)2.45s (± 0.78%)-0.00s (- 0.08%)2.41s2.51s
Total Time11.39s (± 0.42%)11.38s (± 0.22%)-0.02s (- 0.14%)11.31s11.44s
Monaco - node (v14.15.1, x64)
Memory used324,002k (± 0.01%)324,013k (± 0.00%)+11k (+ 0.00%)323,977k324,039k
Parse Time1.50s (± 0.71%)1.51s (± 0.60%)+0.01s (+ 0.47%)1.49s1.53s
Bind Time0.76s (± 1.00%)0.76s (± 0.73%)+0.00s (+ 0.26%)0.74s0.77s
Check Time5.31s (± 0.41%)5.31s (± 0.43%)+0.00s (+ 0.04%)5.27s5.37s
Emit Time3.23s (± 0.61%)3.21s (± 0.51%)-0.02s (- 0.62%)3.18s3.24s
Total Time10.80s (± 0.32%)10.79s (± 0.29%)-0.02s (- 0.16%)10.73s10.86s
TFS - node (v14.15.1, x64)
Memory used288,348k (± 0.01%)288,351k (± 0.01%)+3k (+ 0.00%)288,314k288,393k
Parse Time1.23s (± 0.50%)1.23s (± 0.56%)-0.01s (- 0.41%)1.21s1.24s
Bind Time0.73s (± 0.81%)0.73s (± 0.79%)-0.00s (- 0.54%)0.72s0.74s
Check Time4.92s (± 0.39%)4.91s (± 0.48%)-0.01s (- 0.20%)4.87s4.96s
Emit Time3.47s (± 0.88%)3.46s (± 0.32%)-0.01s (- 0.37%)3.43s3.47s
Total Time10.35s (± 0.33%)10.32s (± 0.26%)-0.03s (- 0.28%)10.28s10.39s
material-ui - node (v14.15.1, x64)
Memory used449,324k (± 0.00%)448,065k (± 0.00%)-1,259k (- 0.28%)448,022k448,112k
Parse Time1.82s (± 0.66%)1.81s (± 0.46%)-0.00s (- 0.11%)1.80s1.83s
Bind Time0.68s (± 0.44%)0.68s (± 0.86%)-0.00s (- 0.15%)0.67s0.69s
Check Time13.09s (± 0.43%)13.15s (± 0.72%)+0.05s (+ 0.41%)12.98s13.34s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.59s (± 0.34%)15.64s (± 0.59%)+0.05s (+ 0.33%)15.47s15.82s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory6 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
BenchmarkNameIterations
Current4522010
Baselinemain10

Developer Information:

Download Benchmark

@andrewbranch
Andrew Branch (andrewbranch) merged commit 9e2fc16 into microsoft:mainOct 12, 2021
@typescript-bot

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser)
The results of the perf run you requested are in!

Here they are:

Comparison Report - main..45220

Metricmain45220DeltaBestWorst
Angular - node (v14.15.1, x64)
Memory used330,486k (± 0.00%)330,249k (± 0.01%)-237k (- 0.07%)330,179k330,308k
Parse Time1.94s (± 0.62%)1.94s (± 0.45%)+0.00s (+ 0.15%)1.92s1.97s
Bind Time0.86s (± 0.40%)0.86s (± 0.55%)+0.00s (+ 0.35%)0.85s0.87s
Check Time5.35s (± 0.33%)5.37s (± 0.44%)+0.01s (+ 0.26%)5.30s5.42s
Emit Time6.14s (± 0.47%)6.23s (± 1.02%)+0.09s (+ 1.43%)6.12s6.43s
Total Time14.29s (± 0.34%)14.40s (± 0.41%)+0.11s (+ 0.76%)14.29s14.53s
Compiler-Unions - node (v14.15.1, x64)
Memory used191,817k (± 0.58%)192,556k (± 0.48%)+738k (+ 0.38%)190,018k193,262k
Parse Time0.81s (± 0.61%)0.80s (± 0.46%)-0.00s (- 0.12%)0.80s0.81s
Bind Time0.55s (± 0.40%)0.56s (± 0.93%)+0.01s (+ 1.45%)0.55s0.57s
Check Time7.58s (± 0.54%)7.59s (± 0.91%)+0.01s (+ 0.09%)7.45s7.75s
Emit Time2.45s (± 1.20%)2.45s (± 0.91%)-0.00s (- 0.12%)2.42s2.53s
Total Time11.39s (± 0.42%)11.40s (± 0.77%)+0.01s (+ 0.08%)11.25s11.65s
Monaco - node (v14.15.1, x64)
Memory used324,002k (± 0.01%)324,005k (± 0.00%)+3k (+ 0.00%)323,974k324,035k
Parse Time1.50s (± 0.71%)1.51s (± 0.59%)+0.01s (+ 0.73%)1.50s1.54s
Bind Time0.76s (± 1.00%)0.75s (± 0.66%)-0.00s (- 0.13%)0.75s0.77s
Check Time5.31s (± 0.41%)5.32s (± 0.63%)+0.01s (+ 0.17%)5.24s5.39s
Emit Time3.23s (± 0.61%)3.23s (± 0.75%)-0.00s (- 0.03%)3.18s3.29s
Total Time10.80s (± 0.32%)10.82s (± 0.46%)+0.01s (+ 0.12%)10.70s10.92s
TFS - node (v14.15.1, x64)
Memory used288,348k (± 0.01%)288,356k (± 0.01%)+8k (+ 0.00%)288,316k288,399k
Parse Time1.23s (± 0.50%)1.24s (± 0.84%)+0.01s (+ 0.57%)1.22s1.26s
Bind Time0.73s (± 0.81%)0.73s (± 0.46%)-0.00s (- 0.14%)0.73s0.74s
Check Time4.92s (± 0.39%)4.93s (± 0.50%)+0.02s (+ 0.33%)4.86s4.97s
Emit Time3.47s (± 0.88%)3.48s (± 0.69%)+0.01s (+ 0.32%)3.44s3.55s
Total Time10.35s (± 0.33%)10.38s (± 0.36%)+0.03s (+ 0.30%)10.27s10.47s
material-ui - node (v14.15.1, x64)
Memory used449,324k (± 0.00%)447,985k (± 0.04%)-1,339k (- 0.30%)447,327k448,110k
Parse Time1.82s (± 0.66%)1.82s (± 0.54%)+0.01s (+ 0.33%)1.80s1.85s
Bind Time0.68s (± 0.44%)0.68s (± 0.69%)+0.00s (+ 0.29%)0.67s0.69s
Check Time13.09s (± 0.43%)13.18s (± 0.75%)+0.08s (+ 0.63%)12.98s13.37s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.59s (± 0.34%)15.68s (± 0.63%)+0.09s (+ 0.58%)15.49s15.87s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory6 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v14.15.1, x64)
BenchmarkNameIterations
Current4522010
Baselinemain10

Developer Information:

Download Benchmark

@ypresto
Yuya Tanaka (ypresto) deleted the perf-large-primitive-union branch October 25, 2021 02:20
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog BugPRs that fix a backlog bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Improve performance for large unions with few non-primitives

7 participants

@ypresto@DanielRosenwasser@typescript-bot@ahejlsberg@amcasey@sandersn@andrewbranch