Skip to content

Cache the regularized form of union types #37749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 3, 2020

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Apr 2, 2020

Fixes #37744

I doubled the example size for good measure. This simple change takes the test run down from 11 minutes to 30 seconds. That 30 seconds could likely still stand to be improved, but this fixes the obvious complexity issue.

@weswigham
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 2, 2020

Heya @weswigham, I've started to run the perf test suite on this PR at d702b0d. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@weswigham
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..37749

Metric master 37749 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 327,821k (± 0.03%) 327,278k (± 0.02%) -543k (- 0.17%) 327,181k 327,399k
Parse Time 1.63s (± 0.64%) 1.64s (± 0.55%) +0.00s (+ 0.18%) 1.62s 1.66s
Bind Time 0.89s (± 0.87%) 0.89s (± 1.06%) -0.00s (- 0.45%) 0.87s 0.90s
Check Time 4.79s (± 0.52%) 4.77s (± 0.53%) -0.02s (- 0.40%) 4.71s 4.82s
Emit Time 5.35s (± 0.55%) 5.32s (± 0.52%) -0.02s (- 0.43%) 5.28s 5.41s
Total Time 12.66s (± 0.32%) 12.61s (± 0.38%) -0.04s (- 0.35%) 12.54s 12.73s
Monaco - node (v10.16.3, x64)
Memory used 327,114k (± 0.02%) 327,171k (± 0.01%) +57k (+ 0.02%) 327,100k 327,248k
Parse Time 1.27s (± 0.68%) 1.27s (± 0.64%) +0.00s (+ 0.16%) 1.25s 1.28s
Bind Time 0.78s (± 0.47%) 0.77s (± 0.29%) -0.01s (- 0.64%) 0.77s 0.78s
Check Time 4.76s (± 0.45%) 4.74s (± 0.24%) -0.02s (- 0.38%) 4.73s 4.78s
Emit Time 2.93s (± 0.55%) 2.93s (± 0.67%) -0.00s (- 0.17%) 2.89s 2.96s
Total Time 9.74s (± 0.23%) 9.71s (± 0.22%) -0.03s (- 0.28%) 9.66s 9.77s
TFS - node (v10.16.3, x64)
Memory used 292,007k (± 0.02%) 292,009k (± 0.02%) +3k (+ 0.00%) 291,863k 292,105k
Parse Time 0.96s (± 0.47%) 0.96s (± 0.49%) +0.00s (+ 0.21%) 0.95s 0.97s
Bind Time 0.75s (± 0.82%) 0.75s (± 0.60%) -0.00s (- 0.13%) 0.74s 0.76s
Check Time 4.26s (± 0.31%) 4.29s (± 0.33%) +0.03s (+ 0.75%) 4.26s 4.32s
Emit Time 3.07s (± 0.67%) 3.09s (± 0.45%) +0.02s (+ 0.65%) 3.07s 3.13s
Total Time 9.04s (± 0.25%) 9.09s (± 0.17%) +0.05s (+ 0.58%) 9.06s 9.13s
material-ui - node (v10.16.3, x64)
Memory used 452,917k (± 0.01%) 452,630k (± 0.01%) -288k (- 0.06%) 452,516k 452,723k
Parse Time 1.78s (± 0.42%) 1.78s (± 0.25%) -0.00s (- 0.11%) 1.77s 1.79s
Bind Time 0.69s (± 0.87%) 0.68s (± 0.54%) -0.00s (- 0.15%) 0.68s 0.69s
Check Time 13.67s (± 0.55%) 13.57s (± 0.77%) -0.10s (- 0.73%) 13.36s 13.81s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.13s (± 0.48%) 16.03s (± 0.67%) -0.10s (- 0.63%) 15.81s 16.29s
Angular - node (v12.1.0, x64)
Memory used 303,205k (± 0.08%) 302,791k (± 0.03%) -414k (- 0.14%) 302,614k 302,926k
Parse Time 1.58s (± 0.46%) 1.58s (± 0.59%) -0.00s (- 0.13%) 1.56s 1.60s
Bind Time 0.87s (± 0.80%) 0.87s (± 0.78%) +0.00s (+ 0.34%) 0.86s 0.89s
Check Time 4.65s (± 0.64%) 4.66s (± 0.19%) +0.01s (+ 0.28%) 4.64s 4.68s
Emit Time 5.48s (± 1.16%) 5.49s (± 0.42%) +0.01s (+ 0.18%) 5.42s 5.55s
Total Time 12.59s (± 0.65%) 12.60s (± 0.27%) +0.02s (+ 0.12%) 12.53s 12.70s
Monaco - node (v12.1.0, x64)
Memory used 307,105k (± 0.01%) 307,101k (± 0.01%) -4k (- 0.00%) 307,008k 307,208k
Parse Time 1.22s (± 0.48%) 1.21s (± 0.58%) -0.01s (- 0.66%) 1.20s 1.23s
Bind Time 0.75s (± 1.39%) 0.75s (± 0.97%) 0.00s ( 0.00%) 0.74s 0.77s
Check Time 4.56s (± 0.49%) 4.56s (± 0.35%) -0.00s (- 0.07%) 4.53s 4.61s
Emit Time 2.95s (± 0.64%) 2.95s (± 0.70%) -0.00s (- 0.10%) 2.91s 3.00s
Total Time 9.48s (± 0.46%) 9.47s (± 0.30%) -0.01s (- 0.09%) 9.41s 9.54s
TFS - node (v12.1.0, x64)
Memory used 274,315k (± 0.02%) 274,333k (± 0.02%) +17k (+ 0.01%) 274,238k 274,479k
Parse Time 0.94s (± 0.73%) 0.94s (± 0.71%) +0.00s (+ 0.11%) 0.92s 0.95s
Bind Time 0.70s (± 0.82%) 0.70s (± 0.79%) +0.00s (+ 0.29%) 0.69s 0.72s
Check Time 4.19s (± 0.41%) 4.18s (± 0.36%) -0.00s (- 0.10%) 4.14s 4.21s
Emit Time 3.09s (± 0.85%) 3.09s (± 0.70%) +0.00s (+ 0.00%) 3.05s 3.14s
Total Time 8.92s (± 0.34%) 8.92s (± 0.34%) +0.00s (+ 0.04%) 8.86s 8.98s
material-ui - node (v12.1.0, x64)
Memory used 430,149k (± 0.07%) 430,070k (± 0.04%) -79k (- 0.02%) 429,421k 430,217k
Parse Time 1.76s (± 0.37%) 1.75s (± 0.49%) -0.01s (- 0.34%) 1.74s 1.77s
Bind Time 0.63s (± 0.64%) 0.63s (± 0.75%) +0.00s (+ 0.64%) 0.63s 0.65s
Check Time 12.12s (± 0.74%) 12.11s (± 0.48%) -0.01s (- 0.07%) 12.00s 12.29s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 14.51s (± 0.62%) 14.50s (± 0.40%) -0.01s (- 0.06%) 14.37s 14.66s
Angular - node (v8.9.0, x64)
Memory used 322,684k (± 0.01%) 322,154k (± 0.01%) -530k (- 0.16%) 322,071k 322,236k
Parse Time 2.12s (± 0.31%) 2.12s (± 0.42%) -0.00s (- 0.05%) 2.10s 2.14s
Bind Time 0.91s (± 0.85%) 0.92s (± 0.83%) +0.00s (+ 0.55%) 0.90s 0.93s
Check Time 5.47s (± 0.36%) 5.46s (± 1.24%) -0.01s (- 0.15%) 5.23s 5.55s
Emit Time 6.21s (± 0.58%) 6.27s (± 1.20%) +0.06s (+ 0.93%) 6.18s 6.54s
Total Time 14.71s (± 0.31%) 14.77s (± 0.21%) +0.06s (+ 0.37%) 14.69s 14.84s
Monaco - node (v8.9.0, x64)
Memory used 325,566k (± 0.01%) 325,578k (± 0.01%) +12k (+ 0.00%) 325,497k 325,629k
Parse Time 1.56s (± 0.65%) 1.55s (± 0.53%) -0.01s (- 0.51%) 1.53s 1.57s
Bind Time 0.90s (± 0.52%) 0.89s (± 0.38%) -0.01s (- 0.78%) 0.89s 0.90s
Check Time 5.39s (± 0.62%) 5.36s (± 0.36%) -0.03s (- 0.59%) 5.33s 5.40s
Emit Time 3.48s (± 0.55%) 3.52s (± 0.85%) +0.04s (+ 1.12%) 3.43s 3.56s
Total Time 11.32s (± 0.48%) 11.32s (± 0.24%) -0.01s (- 0.08%) 11.24s 11.38s
TFS - node (v8.9.0, x64)
Memory used 291,499k (± 0.02%) 291,429k (± 0.01%) -70k (- 0.02%) 291,319k 291,525k
Parse Time 1.26s (± 0.46%) 1.26s (± 0.56%) -0.00s (- 0.08%) 1.24s 1.27s
Bind Time 0.74s (± 0.67%) 0.75s (± 0.78%) +0.00s (+ 0.27%) 0.74s 0.76s
Check Time 4.93s (± 1.26%) 4.93s (± 1.78%) +0.00s (+ 0.02%) 4.79s 5.12s
Emit Time 3.25s (± 3.38%) 3.26s (± 2.63%) +0.01s (+ 0.31%) 3.05s 3.40s
Total Time 10.19s (± 0.68%) 10.20s (± 0.35%) +0.01s (+ 0.11%) 10.13s 10.29s
material-ui - node (v8.9.0, x64)
Memory used 455,565k (± 0.01%) 455,257k (± 0.02%) -308k (- 0.07%) 455,093k 455,447k
Parse Time 2.11s (± 0.32%) 2.12s (± 0.47%) +0.01s (+ 0.28%) 2.10s 2.14s
Bind Time 0.81s (± 0.73%) 0.80s (± 0.81%) -0.01s (- 1.47%) 0.79s 0.82s
Check Time 17.71s (± 0.85%) 17.62s (± 1.00%) -0.08s (- 0.46%) 17.27s 18.00s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 20.63s (± 0.76%) 20.54s (± 0.86%) -0.09s (- 0.43%) 20.18s 20.92s
Angular - node (v8.9.0, x86)
Memory used 185,659k (± 0.02%) 185,491k (± 0.02%) -168k (- 0.09%) 185,397k 185,565k
Parse Time 2.06s (± 0.58%) 2.06s (± 0.49%) -0.00s (- 0.05%) 2.03s 2.08s
Bind Time 1.07s (± 0.68%) 1.06s (± 0.45%) -0.01s (- 0.84%) 1.05s 1.07s
Check Time 5.00s (± 0.61%) 4.99s (± 0.36%) -0.01s (- 0.22%) 4.95s 5.04s
Emit Time 6.05s (± 0.72%) 6.09s (± 0.85%) +0.03s (+ 0.53%) 5.98s 6.22s
Total Time 14.18s (± 0.34%) 14.19s (± 0.40%) +0.01s (+ 0.11%) 14.07s 14.31s
Monaco - node (v8.9.0, x86)
Memory used 185,385k (± 0.02%) 185,413k (± 0.02%) +28k (+ 0.01%) 185,348k 185,483k
Parse Time 1.59s (± 0.37%) 1.59s (± 0.25%) -0.00s (- 0.19%) 1.58s 1.60s
Bind Time 0.76s (± 0.48%) 0.76s (± 0.76%) -0.00s (- 0.13%) 0.75s 0.78s
Check Time 5.42s (± 1.10%) 5.40s (± 0.40%) -0.02s (- 0.33%) 5.36s 5.45s
Emit Time 2.87s (± 0.37%) 2.85s (± 0.66%) -0.02s (- 0.63%) 2.78s 2.88s
Total Time 10.65s (± 0.65%) 10.61s (± 0.24%) -0.04s (- 0.37%) 10.55s 10.66s
TFS - node (v8.9.0, x86)
Memory used 166,890k (± 0.01%) 166,836k (± 0.02%) -54k (- 0.03%) 166,757k 166,916k
Parse Time 1.30s (± 0.83%) 1.29s (± 0.46%) -0.01s (- 1.00%) 1.27s 1.30s
Bind Time 0.72s (± 1.54%) 0.71s (± 1.41%) -0.00s (- 0.42%) 0.70s 0.74s
Check Time 4.64s (± 0.78%) 4.63s (± 0.57%) -0.01s (- 0.28%) 4.56s 4.68s
Emit Time 2.98s (± 0.93%) 3.01s (± 1.52%) +0.02s (+ 0.67%) 2.96s 3.18s
Total Time 9.64s (± 0.42%) 9.64s (± 0.61%) -0.01s (- 0.06%) 9.56s 9.85s
material-ui - node (v8.9.0, x86)
Memory used 257,714k (± 0.02%) 257,561k (± 0.01%) -153k (- 0.06%) 257,488k 257,652k
Parse Time 2.18s (± 0.65%) 2.18s (± 0.65%) -0.00s (- 0.05%) 2.16s 2.23s
Bind Time 0.68s (± 1.39%) 0.68s (± 0.70%) -0.00s (- 0.15%) 0.67s 0.69s
Check Time 16.22s (± 0.64%) 16.18s (± 0.59%) -0.03s (- 0.22%) 16.03s 16.42s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 19.08s (± 0.56%) 19.04s (± 0.51%) -0.04s (- 0.19%) 18.89s 19.28s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-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 (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v8.9.0, x64)
  • material-ui - node (v8.9.0, x86)
Benchmark Name Iterations
Current 37749 10
Baseline master 10

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

Seems like a good idea. One thing though: Why didn't memory usage improve? Are our perf tests actually creating enough unions to test this?

@@ -0,0 +1,8012 @@
type BigUnion =
{
name: '0';
Copy link
Member

Choose a reason for hiding this comment

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

how long does does the original 1,000 take without the fix? 30 seconds post-fix is still pretty long to wait for a test to run.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's actually timing out on CI because it's taking more than 40 seconds there. I may need to either trim it a bit, or try to see what else is doing poorly and improve the perf more. 40 seconds for a single file with 6 statements and no control flow is still unreasonably bad, just not as unreasonable.

@sandersn
Copy link
Member

sandersn commented Apr 2, 2020

Oops, I meant, why doesn't memory usage increase, not improve.

@weswigham
Copy link
Member Author

Oops, I meant, why doesn't memory usage increase, not improve.

Why would memory usage change? Unions are globally cached so long as their members are the same, so the final type counts are inevitably the same. All that's different is we now keep a direct reference to the result on the union (saving us from needing to iterate over it more than once), which means the only addition is a property, which are allocated by the vm in blocks (rather than one at a time) anyway.

@sandersn
Copy link
Member

sandersn commented Apr 2, 2020

The VM allocating properties in blocks was the missing piece in my understanding. Thanks.

const sourceType = sourceTypes[i];
if (target.flags & TypeFlags.Union && (target as UnionType).types.length === sourceTypes.length) {
// many unions are mappings of one another; in such cases, simply comparing members at the same index can shortcut the comparison
const related = isRelatedTo(sourceType, (target as UnionType).types[i], /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState);
Copy link
Member

Choose a reason for hiding this comment

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

Not sure I see why this would help. Union constituents are sorted by their type ids and those are pretty random even when one union is a mapping of the other. Am I missing something?

Copy link
Member Author

@weswigham weswigham Apr 3, 2020

Choose a reason for hiding this comment

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

Type IDs are assigned as they are made, and unions are sorted; ergo, unions are ordered by the order the types within them were created in - for a union that results from a mapping on another union, that means the resulting union will share the input union's order. We exploit this here by checking those corresponding elements against one another to make this common case linear in comparison time (when the result is assignable), rather than quadratic.

Copy link
Member Author

Choose a reason for hiding this comment

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

This change is responsible for most of the performance improvements from the last commit, not the other one. The other one allows us to skip one silly quadratic comparison of a union to itself, while this is allowing us to compare BigUnion to DiscriminateType<BigUnion, "name", T> in a linear way (DiscriminateType is a distributive conditional, so produces a union of types which are ultimately identical to BigUnion, as T is constrained to the values of "name").

Copy link
Member

Choose a reason for hiding this comment

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

Right, in cases where the mapping creates new type IDs for each element I can see how this helps.

@weswigham
Copy link
Member Author

So my last commit takes the test runtime locally down from 30s to 5s, but CI is failing on npm install because a version of rxjs is missing from the registry!?!?

@weswigham
Copy link
Member Author

@typescript-bot perf test this

At least travis is green 😾 - hopefully perf can install and run.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 3, 2020

Heya @weswigham, I've started to run the perf test suite on this PR at cbf1b04. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@weswigham
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..37749

Metric master 37749 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 327,849k (± 0.02%) 327,085k (± 0.03%) -763k (- 0.23%) 326,860k 327,388k
Parse Time 1.63s (± 0.40%) 1.63s (± 0.57%) -0.00s (- 0.25%) 1.61s 1.65s
Bind Time 0.89s (± 0.69%) 0.89s (± 0.77%) -0.01s (- 0.56%) 0.87s 0.90s
Check Time 4.77s (± 0.46%) 4.76s (± 0.68%) -0.01s (- 0.25%) 4.67s 4.82s
Emit Time 5.33s (± 0.59%) 5.32s (± 0.58%) -0.01s (- 0.23%) 5.24s 5.38s
Total Time 12.63s (± 0.32%) 12.59s (± 0.47%) -0.03s (- 0.26%) 12.49s 12.70s
Monaco - node (v10.16.3, x64)
Memory used 327,152k (± 0.01%) 327,096k (± 0.01%) -56k (- 0.02%) 326,970k 327,238k
Parse Time 1.26s (± 0.44%) 1.26s (± 0.71%) +0.00s (+ 0.24%) 1.24s 1.28s
Bind Time 0.77s (± 0.47%) 0.77s (± 0.58%) -0.00s (- 0.26%) 0.76s 0.78s
Check Time 4.74s (± 0.74%) 4.75s (± 0.45%) +0.00s (+ 0.08%) 4.70s 4.79s
Emit Time 2.93s (± 1.23%) 2.94s (± 0.60%) +0.01s (+ 0.20%) 2.91s 2.98s
Total Time 9.71s (± 0.64%) 9.73s (± 0.29%) +0.01s (+ 0.12%) 9.65s 9.79s
TFS - node (v10.16.3, x64)
Memory used 291,990k (± 0.02%) 292,045k (± 0.02%) +56k (+ 0.02%) 291,824k 292,185k
Parse Time 0.96s (± 0.60%) 0.96s (± 0.49%) -0.00s (- 0.00%) 0.95s 0.97s
Bind Time 0.74s (± 0.67%) 0.74s (± 0.49%) -0.00s (- 0.13%) 0.74s 0.75s
Check Time 4.28s (± 0.51%) 4.31s (± 0.46%) +0.04s (+ 0.82%) 4.28s 4.37s
Emit Time 3.07s (± 0.57%) 3.05s (± 0.94%) -0.02s (- 0.62%) 2.99s 3.11s
Total Time 9.05s (± 0.37%) 9.07s (± 0.54%) +0.02s (+ 0.19%) 8.96s 9.16s
material-ui - node (v10.16.3, x64)
Memory used 452,881k (± 0.01%) 449,919k (± 0.02%) -2,963k (- 0.65%) 449,750k 450,095k
Parse Time 1.78s (± 0.39%) 1.77s (± 0.38%) -0.01s (- 0.45%) 1.76s 1.79s
Bind Time 0.68s (± 0.50%) 0.68s (± 0.91%) -0.00s (- 0.29%) 0.67s 0.69s
Check Time 13.73s (± 0.57%) 13.08s (± 0.54%) 🟩-0.65s (- 4.72%) 12.97s 13.29s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.19s (± 0.48%) 15.53s (± 0.46%) 🟩-0.66s (- 4.06%) 15.42s 15.75s
Angular - node (v12.1.0, x64)
Memory used 303,355k (± 0.02%) 302,636k (± 0.03%) -719k (- 0.24%) 302,302k 302,820k
Parse Time 1.58s (± 0.46%) 1.58s (± 0.42%) +0.00s (+ 0.06%) 1.56s 1.59s
Bind Time 0.87s (± 0.54%) 0.87s (± 0.60%) +0.00s (+ 0.11%) 0.86s 0.88s
Check Time 4.64s (± 0.24%) 4.63s (± 0.18%) -0.00s (- 0.11%) 4.62s 4.66s
Emit Time 5.51s (± 0.44%) 5.46s (± 0.61%) -0.05s (- 0.96%) 5.41s 5.55s
Total Time 12.60s (± 0.27%) 12.55s (± 0.28%) -0.05s (- 0.44%) 12.50s 12.64s
Monaco - node (v12.1.0, x64)
Memory used 307,108k (± 0.02%) 306,973k (± 0.01%) -134k (- 0.04%) 306,874k 307,061k
Parse Time 1.22s (± 0.57%) 1.21s (± 0.68%) -0.01s (- 0.41%) 1.20s 1.23s
Bind Time 0.74s (± 0.40%) 0.74s (± 0.30%) -0.00s (- 0.40%) 0.73s 0.74s
Check Time 4.57s (± 0.43%) 4.54s (± 0.37%) -0.02s (- 0.55%) 4.50s 4.58s
Emit Time 2.97s (± 0.68%) 2.96s (± 0.70%) -0.01s (- 0.27%) 2.92s 3.01s
Total Time 9.50s (± 0.29%) 9.46s (± 0.26%) -0.04s (- 0.41%) 9.40s 9.52s
TFS - node (v12.1.0, x64)
Memory used 274,288k (± 0.03%) 274,254k (± 0.03%) -34k (- 0.01%) 274,132k 274,465k
Parse Time 0.94s (± 1.27%) 0.94s (± 0.63%) -0.00s (- 0.43%) 0.92s 0.95s
Bind Time 0.70s (± 0.70%) 0.71s (± 2.28%) +0.01s (+ 1.28%) 0.69s 0.77s
Check Time 4.20s (± 0.62%) 4.20s (± 0.54%) 0.00s ( 0.00%) 4.15s 4.26s
Emit Time 3.12s (± 0.91%) 3.09s (± 0.67%) -0.03s (- 0.90%) 3.04s 3.13s
Total Time 8.96s (± 0.51%) 8.93s (± 0.35%) -0.02s (- 0.27%) 8.88s 9.01s
material-ui - node (v12.1.0, x64)
Memory used 430,295k (± 0.01%) 427,497k (± 0.01%) -2,798k (- 0.65%) 427,390k 427,656k
Parse Time 1.75s (± 0.50%) 1.75s (± 0.35%) -0.00s (- 0.11%) 1.74s 1.76s
Bind Time 0.63s (± 0.57%) 0.64s (± 0.78%) +0.00s (+ 0.16%) 0.63s 0.65s
Check Time 12.13s (± 0.56%) 11.57s (± 0.38%) 🟩-0.57s (- 4.66%) 11.46s 11.69s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 14.52s (± 0.48%) 13.96s (± 0.35%) 🟩-0.56s (- 3.86%) 13.84s 14.09s
Angular - node (v8.9.0, x64)
Memory used 322,700k (± 0.02%) 321,994k (± 0.01%) -707k (- 0.22%) 321,878k 322,056k
Parse Time 2.12s (± 0.34%) 2.11s (± 0.52%) -0.01s (- 0.38%) 2.09s 2.14s
Bind Time 0.92s (± 0.52%) 0.92s (± 0.65%) -0.00s (- 0.11%) 0.90s 0.93s
Check Time 5.47s (± 0.44%) 5.43s (± 0.72%) -0.04s (- 0.66%) 5.30s 5.51s
Emit Time 6.27s (± 0.76%) 6.24s (± 0.95%) -0.03s (- 0.40%) 6.16s 6.41s
Total Time 14.78s (± 0.30%) 14.71s (± 0.42%) -0.07s (- 0.47%) 14.61s 14.92s
Monaco - node (v8.9.0, x64)
Memory used 325,577k (± 0.02%) 325,445k (± 0.01%) -132k (- 0.04%) 325,332k 325,513k
Parse Time 1.55s (± 0.56%) 1.55s (± 0.37%) -0.00s (- 0.32%) 1.54s 1.56s
Bind Time 0.90s (± 1.43%) 0.89s (± 0.45%) -0.01s (- 1.33%) 0.88s 0.90s
Check Time 5.39s (± 0.49%) 5.38s (± 0.44%) -0.01s (- 0.19%) 5.32s 5.43s
Emit Time 3.51s (± 0.61%) 3.51s (± 0.34%) -0.01s (- 0.26%) 3.48s 3.53s
Total Time 11.36s (± 0.29%) 11.32s (± 0.18%) -0.04s (- 0.31%) 11.27s 11.38s
TFS - node (v8.9.0, x64)
Memory used 291,437k (± 0.02%) 291,486k (± 0.01%) +48k (+ 0.02%) 291,358k 291,561k
Parse Time 1.26s (± 0.38%) 1.26s (± 0.47%) +0.01s (+ 0.56%) 1.25s 1.28s
Bind Time 0.74s (± 0.64%) 0.75s (± 0.82%) +0.01s (+ 0.81%) 0.74s 0.76s
Check Time 4.92s (± 1.40%) 5.03s (± 1.73%) +0.10s (+ 2.09%) 4.84s 5.20s
Emit Time 3.24s (± 2.80%) 3.18s (± 2.79%) -0.06s (- 1.76%) 3.06s 3.38s
Total Time 10.16s (± 0.27%) 10.22s (± 0.36%) +0.06s (+ 0.58%) 10.16s 10.30s
material-ui - node (v8.9.0, x64)
Memory used 455,541k (± 0.02%) 452,433k (± 0.01%) -3,108k (- 0.68%) 452,323k 452,572k
Parse Time 2.12s (± 0.43%) 2.12s (± 0.59%) -0.00s (- 0.24%) 2.09s 2.15s
Bind Time 0.81s (± 0.95%) 0.81s (± 0.72%) +0.00s (+ 0.25%) 0.80s 0.82s
Check Time 17.58s (± 0.64%) 16.96s (± 0.70%) 🟩-0.62s (- 3.51%) 16.75s 17.20s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 20.50s (± 0.56%) 19.89s (± 0.59%) 🟩-0.62s (- 3.01%) 19.65s 20.11s
Angular - node (v8.9.0, x86)
Memory used 185,719k (± 0.02%) 185,410k (± 0.02%) -310k (- 0.17%) 185,310k 185,469k
Parse Time 2.06s (± 0.52%) 2.05s (± 0.83%) -0.00s (- 0.10%) 2.03s 2.10s
Bind Time 1.08s (± 0.46%) 1.07s (± 0.44%) -0.01s (- 0.56%) 1.06s 1.08s
Check Time 4.99s (± 0.50%) 4.96s (± 0.42%) -0.03s (- 0.64%) 4.92s 5.01s
Emit Time 6.08s (± 0.90%) 6.03s (± 1.24%) -0.06s (- 0.92%) 5.89s 6.26s
Total Time 14.20s (± 0.47%) 14.11s (± 0.57%) -0.10s (- 0.68%) 13.91s 14.31s
Monaco - node (v8.9.0, x86)
Memory used 185,401k (± 0.02%) 185,349k (± 0.02%) -52k (- 0.03%) 185,301k 185,486k
Parse Time 1.59s (± 0.47%) 1.60s (± 0.47%) +0.00s (+ 0.19%) 1.58s 1.61s
Bind Time 0.77s (± 0.76%) 0.77s (± 0.67%) +0.00s (+ 0.52%) 0.76s 0.78s
Check Time 5.41s (± 0.64%) 5.39s (± 0.34%) -0.02s (- 0.35%) 5.34s 5.44s
Emit Time 2.87s (± 0.93%) 2.86s (± 0.61%) -0.01s (- 0.31%) 2.82s 2.90s
Total Time 10.65s (± 0.35%) 10.62s (± 0.33%) -0.03s (- 0.28%) 10.54s 10.71s
TFS - node (v8.9.0, x86)
Memory used 166,900k (± 0.02%) 166,869k (± 0.03%) -32k (- 0.02%) 166,780k 166,962k
Parse Time 1.29s (± 0.81%) 1.29s (± 0.63%) +0.01s (+ 0.39%) 1.28s 1.32s
Bind Time 0.71s (± 0.63%) 0.71s (± 0.51%) +0.00s (+ 0.28%) 0.71s 0.72s
Check Time 4.63s (± 0.58%) 4.64s (± 0.63%) +0.01s (+ 0.15%) 4.58s 4.71s
Emit Time 2.99s (± 2.51%) 3.02s (± 1.91%) +0.04s (+ 1.17%) 2.96s 3.22s
Total Time 9.62s (± 0.74%) 9.67s (± 0.56%) +0.05s (+ 0.49%) 9.56s 9.83s
material-ui - node (v8.9.0, x86)
Memory used 257,753k (± 0.01%) 256,133k (± 0.02%) -1,620k (- 0.63%) 256,030k 256,288k
Parse Time 2.17s (± 0.63%) 2.18s (± 0.61%) +0.01s (+ 0.32%) 2.16s 2.21s
Bind Time 0.69s (± 0.75%) 0.69s (± 1.70%) +0.00s (+ 0.29%) 0.67s 0.73s
Check Time 16.30s (± 0.62%) 15.56s (± 0.84%) 🟩-0.74s (- 4.56%) 15.34s 15.87s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 19.17s (± 0.55%) 18.43s (± 0.73%) 🟩-0.74s (- 3.85%) 18.20s 18.76s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-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 (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v8.9.0, x64)
  • material-ui - node (v8.9.0, x86)
Benchmark Name Iterations
Current 37749 10
Baseline master 10

@ahejlsberg
Copy link
Member

Nice improvement on material-ui check time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Degenerate compiler performance when processing large unions
4 participants