Skip to content
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

Add heuristic for extracting irreducible null and undefined types from intersections of unions #33150

Merged
merged 1 commit into from Sep 6, 2019

Conversation

weswigham
Copy link
Member

Fixes #33130

@weswigham
Copy link
Member Author

@typescript-bot test this
@typescript-bot user test this
@typescript-bot run dt

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 29, 2019

Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at 67ddb65. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 29, 2019

Heya @weswigham, I've started to run the extended test suite on this PR at 67ddb65. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 29, 2019

Heya @weswigham, I've started to run the parallelized community code test suite on this PR at 67ddb65. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@weswigham
Copy link
Member Author

weswigham commented Aug 29, 2019

For the third time today, once again the user baselines are just today's as yet uncaptured/accepted update (just changes in upstream projects), so are clean~

@sandersn sandersn added this to the TypeScript 3.6.3 milestone Sep 4, 2019
@sandersn
Copy link
Member

sandersn commented Sep 4, 2019

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 4, 2019

Heya @sandersn, I've started to run the perf test suite on this PR at 67ddb65. You can monitor the build here. It should now contribute to this PR's status checks.

Update: The results are in!

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.

Some perf questions, plus wondering whether we should support x | null | undefined & ...

@@ -9996,6 +9996,16 @@ namespace ts {
return true;
}

function extractIrreducible(types: Type[], flag: TypeFlags) {
if (every(types, t => !!(t.flags & TypeFlags.Union) && some((t as UnionType).types, tt => !!(tt.flags & flag)))) {
Copy link
Member

Choose a reason for hiding this comment

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

could you add Null and Undefined to TypeFlags.IncludesMask to avoid the second check?

actually, would it be possible to add a special TypeFlags.EveryUnion that gets calculated in addTypesToIntersection and then added to includes? This uses up another TypeFlags, but is faster than trying to return two things. So..maybe not worth it.

I do notice that the two calls to extractIrreducible might iterate typeSet twice whenever it contains all-unions, but doesn't have any null or undefineds.

Copy link
Member Author

@weswigham weswigham Sep 4, 2019

Choose a reason for hiding this comment

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

could you add Null and Undefined to TypeFlags.IncludesMask to avoid the second check?

Nope, because we're looking for members-of-members that are undefined-or-null. We'd need 3 (or two) brand new flags (null and undefined are already used to track weather the intersection itself contains them). One for "every member is a union", one for "every member contains undefined", and one for "every member contains null". We only have two unused type flags left (all currently assigned type flags have a meaning in intersection construction), sooo.... Yeah.

This already bails early in every common scenario, the worst case where it's not needed is soemthing like a 52 element union where the first 51 contain undefined, but the 52nd contains null, which is irreducible and, notably, will trigger the "excessively large union" check in the else clause once the filtering fails, and cease to do any more work. So the "worst case" is either the case where it needs to occur and all the work needs to be done, or where it's very close to that but not, and will likely be converted to any, anyway.

@@ -10114,6 +10124,12 @@ namespace ts {
// reduced we'll never reduce again, so this occurs at most once.
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
}
else if (extractIrreducible(typeSet, TypeFlags.Undefined)) {
result = getUnionType([getIntersectionType(typeSet), undefinedType], UnionReduction.Literal, aliasSymbol, aliasTypeArguments);
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't we run both, for large intersections of the form x | null | undefined & ...?

Copy link
Member Author

Choose a reason for hiding this comment

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

we do - note the recursive getIntersectionType call (which is needed to recalculate includes for the now filtered type set)

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..33150

Metric master 33150 Delta Best Worst
Angular - node (v12.1.0, x64)
Memory used 325,540k (± 0.01%) 325,879k (± 0.02%) +339k (+ 0.10%) 325,746k 326,024k
Parse Time 1.48s (± 0.58%) 1.60s (± 1.82%) +0.12s (+ 7.89%) 1.57s 1.71s
Bind Time 0.76s (± 0.53%) 0.83s (± 0.98%) +0.07s (+ 9.46%) 0.81s 0.85s
Check Time 4.20s (± 0.44%) 4.50s (± 0.46%) +0.30s (+ 7.15%) 4.45s 4.55s
Emit Time 5.26s (± 0.80%) 5.61s (± 0.28%) +0.36s (+ 6.79%) 5.57s 5.64s
Total Time 11.69s (± 0.46%) 12.54s (± 0.32%) +0.85s (+ 7.25%) 12.46s 12.63s
Monaco - node (v12.1.0, x64)
Memory used 345,912k (± 0.01%) 345,872k (± 0.01%) -40k (- 0.01%) 345,800k 346,025k
Parse Time 1.22s (± 0.54%) 1.32s (± 1.94%) +0.10s (+ 8.28%) 1.30s 1.42s
Bind Time 0.68s (± 0.74%) 0.72s (± 1.30%) +0.05s (+ 7.11%) 0.70s 0.74s
Check Time 4.24s (± 0.37%) 4.51s (± 0.60%) +0.27s (+ 6.44%) 4.45s 4.57s
Emit Time 2.85s (± 0.54%) 3.03s (± 0.78%) +0.18s (+ 6.28%) 2.99s 3.10s
Total Time 8.98s (± 0.28%) 9.59s (± 0.49%) +0.61s (+ 6.76%) 9.49s 9.68s
TFS - node (v12.1.0, x64)
Memory used 301,414k (± 0.02%) 301,382k (± 0.01%) -32k (- 0.01%) 301,292k 301,503k
Parse Time 0.95s (± 0.61%) 1.03s (± 1.34%) +0.08s (+ 8.34%) 1.00s 1.07s
Bind Time 0.62s (± 0.72%) 0.67s (± 0.78%) +0.05s (+ 7.56%) 0.66s 0.68s
Check Time 3.86s (± 0.42%) 4.10s (± 0.66%) +0.24s (+ 6.20%) 4.03s 4.15s
Emit Time 2.97s (± 0.81%) 3.12s (± 0.83%) +0.15s (+ 5.02%) 3.07s 3.18s
Total Time 8.39s (± 0.27%) 8.90s (± 0.63%) +0.51s (+ 6.08%) 8.78s 9.00s
Angular - node (v8.9.0, x64)
Memory used 344,215k (± 0.02%) 344,550k (± 0.02%) +335k (+ 0.10%) 344,405k 344,694k
Parse Time 1.99s (± 0.37%) 2.09s (± 0.39%) +0.10s (+ 5.12%) 2.08s 2.12s
Bind Time 0.81s (± 0.73%) 0.88s (± 0.77%) +0.07s (+ 8.60%) 0.87s 0.90s
Check Time 5.04s (± 0.75%) 5.36s (± 0.72%) +0.32s (+ 6.41%) 5.28s 5.46s
Emit Time 6.05s (± 0.92%) 6.56s (± 0.68%) +0.51s (+ 8.41%) 6.46s 6.63s
Total Time 13.89s (± 0.56%) 14.89s (± 0.43%) +1.00s (+ 7.21%) 14.78s 15.07s
Monaco - node (v8.9.0, x64)
Memory used 363,676k (± 0.01%) 363,701k (± 0.02%) +25k (+ 0.01%) 363,539k 363,823k
Parse Time 1.55s (± 0.26%) 1.62s (± 0.36%) +0.07s (+ 4.39%) 1.61s 1.63s
Bind Time 0.88s (± 0.83%) 0.94s (± 0.53%) +0.05s (+ 6.12%) 0.92s 0.94s
Check Time 5.15s (± 1.63%) 5.37s (± 1.01%) +0.23s (+ 4.45%) 5.25s 5.54s
Emit Time 3.16s (± 4.66%) 3.50s (± 2.80%) +0.35s (+11.02%) 3.12s 3.60s
Total Time 10.74s (± 0.68%) 11.43s (± 0.75%) +0.70s (+ 6.47%) 11.18s 11.57s
TFS - node (v8.9.0, x64)
Memory used 317,647k (± 0.02%) 317,634k (± 0.01%) -13k (- 0.00%) 317,575k 317,702k
Parse Time 1.26s (± 0.47%) 1.31s (± 0.58%) +0.05s (+ 3.90%) 1.29s 1.32s
Bind Time 0.68s (± 3.66%) 0.81s (± 5.68%) +0.13s (+19.38%) 0.69s 0.87s
Check Time 4.48s (± 0.99%) 4.64s (± 0.92%) +0.16s (+ 3.64%) 4.58s 4.77s
Emit Time 3.07s (± 0.57%) 3.26s (± 0.87%) +0.19s (+ 6.05%) 3.18s 3.30s
Total Time 9.49s (± 0.39%) 10.03s (± 0.55%) +0.53s (+ 5.63%) 9.91s 10.17s
Angular - node (v8.9.0, x86)
Memory used 194,976k (± 0.02%) 195,157k (± 0.02%) +181k (+ 0.09%) 195,050k 195,240k
Parse Time 1.93s (± 0.77%) 2.02s (± 0.70%) +0.09s (+ 4.46%) 1.99s 2.05s
Bind Time 0.94s (± 0.52%) 1.00s (± 0.76%) +0.05s (+ 5.40%) 0.98s 1.02s
Check Time 4.60s (± 0.89%) 4.89s (± 0.58%) +0.29s (+ 6.21%) 4.83s 4.97s
Emit Time 5.80s (± 1.04%) 6.23s (± 1.14%) +0.43s (+ 7.43%) 6.12s 6.48s
Total Time 13.28s (± 0.65%) 14.13s (± 0.62%) +0.86s (+ 6.45%) 13.95s 14.38s
Monaco - node (v8.9.0, x86)
Memory used 203,228k (± 0.02%) 203,207k (± 0.02%) -21k (- 0.01%) 203,140k 203,295k
Parse Time 1.62s (± 0.68%) 1.69s (± 0.89%) +0.07s (+ 4.21%) 1.66s 1.73s
Bind Time 0.72s (± 1.13%) 0.75s (± 0.59%) +0.03s (+ 4.44%) 0.74s 0.76s
Check Time 4.88s (± 0.68%) 5.15s (± 0.58%) +0.27s (+ 5.51%) 5.07s 5.20s
Emit Time 3.19s (± 0.70%) 3.36s (± 0.63%) +0.17s (+ 5.33%) 3.33s 3.42s
Total Time 10.40s (± 0.47%) 10.94s (± 0.39%) +0.53s (+ 5.12%) 10.85s 11.02s
TFS - node (v8.9.0, x86)
Memory used 178,508k (± 0.02%) 178,497k (± 0.01%) -11k (- 0.01%) 178,452k 178,573k
Parse Time 1.31s (± 0.82%) 1.36s (± 0.50%) +0.05s (+ 4.12%) 1.35s 1.38s
Bind Time 0.64s (± 0.87%) 0.67s (± 0.78%) +0.03s (+ 4.86%) 0.66s 0.68s
Check Time 4.29s (± 0.33%) 4.52s (± 0.75%) +0.23s (+ 5.45%) 4.47s 4.65s
Emit Time 2.87s (± 0.96%) 3.02s (± 1.29%) +0.15s (+ 5.09%) 2.96s 3.15s
Total Time 9.11s (± 0.39%) 9.57s (± 0.70%) +0.46s (+ 5.09%) 9.47s 9.81s
Angular - node (v9.0.0, x64)
Memory used 343,865k (± 0.02%) 344,145k (± 0.02%) +281k (+ 0.08%) 344,030k 344,350k
Parse Time 1.71s (± 0.51%) 1.80s (± 0.64%) +0.09s (+ 5.21%) 1.78s 1.83s
Bind Time 0.76s (± 0.76%) 0.82s (± 0.83%) +0.06s (+ 7.37%) 0.80s 0.83s
Check Time 4.77s (± 0.44%) 5.03s (± 0.51%) +0.25s (+ 5.32%) 4.99s 5.10s
Emit Time 5.69s (± 1.79%) 6.11s (± 1.36%) +0.42s (+ 7.31%) 5.89s 6.22s
Total Time 12.93s (± 0.77%) 13.75s (± 0.55%) +0.82s (+ 6.33%) 13.51s 13.85s
Monaco - node (v9.0.0, x64)
Memory used 363,339k (± 0.02%) 363,456k (± 0.01%) +117k (+ 0.03%) 363,343k 363,577k
Parse Time 1.31s (± 0.55%) 1.39s (± 0.50%) +0.08s (+ 5.87%) 1.38s 1.41s
Bind Time 0.84s (± 0.86%) 0.86s (± 0.79%) +0.02s (+ 2.61%) 0.85s 0.88s
Check Time 4.97s (± 1.42%) 5.44s (± 0.37%) +0.47s (+ 9.56%) 5.40s 5.48s
Emit Time 3.26s (± 4.47%) 3.06s (± 0.56%) -0.20s (- 6.19%) 3.03s 3.10s
Total Time 10.39s (± 0.80%) 10.76s (± 0.26%) +0.37s (+ 3.51%) 10.70s 10.80s
TFS - node (v9.0.0, x64)
Memory used 317,458k (± 0.02%) 317,439k (± 0.01%) -19k (- 0.01%) 317,359k 317,551k
Parse Time 1.04s (± 0.62%) 1.10s (± 0.31%) +0.05s (+ 5.28%) 1.09s 1.10s
Bind Time 0.62s (± 0.79%) 0.66s (± 0.75%) +0.03s (+ 5.13%) 0.65s 0.67s
Check Time 4.38s (± 0.77%) 4.64s (± 0.58%) +0.26s (+ 5.89%) 4.61s 4.72s
Emit Time 3.18s (± 1.74%) 3.37s (± 0.53%) +0.19s (+ 5.84%) 3.35s 3.43s
Total Time 9.23s (± 0.54%) 9.76s (± 0.28%) +0.53s (+ 5.72%) 9.71s 9.82s
Angular - node (v9.0.0, x86)
Memory used 195,105k (± 0.02%) 195,291k (± 0.02%) +186k (+ 0.10%) 195,183k 195,425k
Parse Time 1.63s (± 0.87%) 1.73s (± 0.61%) +0.10s (+ 5.88%) 1.71s 1.75s
Bind Time 0.89s (± 0.56%) 0.94s (± 0.93%) +0.05s (+ 6.09%) 0.93s 0.97s
Check Time 4.23s (± 0.42%) 4.53s (± 0.65%) +0.30s (+ 7.06%) 4.49s 4.63s
Emit Time 5.53s (± 0.63%) 5.84s (± 0.60%) +0.31s (+ 5.70%) 5.75s 5.94s
Total Time 12.28s (± 0.28%) 13.04s (± 0.42%) +0.76s (+ 6.22%) 12.90s 13.19s
Monaco - node (v9.0.0, x86)
Memory used 203,260k (± 0.02%) 203,234k (± 0.03%) -26k (- 0.01%) 203,127k 203,339k
Parse Time 1.34s (± 0.50%) 1.42s (± 0.48%) +0.09s (+ 6.51%) 1.41s 1.44s
Bind Time 0.65s (± 1.06%) 0.69s (± 0.53%) +0.04s (+ 6.36%) 0.68s 0.69s
Check Time 4.69s (± 0.56%) 5.00s (± 0.55%) +0.31s (+ 6.53%) 4.95s 5.09s
Emit Time 3.08s (± 0.67%) 3.27s (± 0.41%) +0.19s (+ 6.14%) 3.25s 3.31s
Total Time 9.75s (± 0.45%) 10.37s (± 0.28%) +0.62s (+ 6.39%) 10.31s 10.45s
TFS - node (v9.0.0, x86)
Memory used 178,630k (± 0.02%) 178,558k (± 0.02%) -72k (- 0.04%) 178,486k 178,617k
Parse Time 1.06s (± 0.45%) 1.12s (± 0.74%) +0.07s (+ 6.34%) 1.11s 1.14s
Bind Time 0.58s (± 1.34%) 0.61s (± 1.11%) +0.04s (+ 6.04%) 0.60s 0.63s
Check Time 4.13s (± 0.61%) 4.38s (± 0.34%) +0.25s (+ 6.11%) 4.35s 4.41s
Emit Time 2.78s (± 0.58%) 2.93s (± 0.54%) +0.15s (+ 5.21%) 2.90s 2.96s
Total Time 8.55s (± 0.42%) 9.05s (± 0.23%) +0.50s (+ 5.81%) 9.01s 9.11s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-161-generic
Architecturex64
Available Memory16 GB
Available Memory14 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
  • node (v9.0.0, x64)
  • node (v9.0.0, x86)
Scenarios
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Angular - node (v9.0.0, x64)
  • Angular - node (v9.0.0, x86)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • Monaco - node (v9.0.0, x64)
  • Monaco - node (v9.0.0, x86)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
  • TFS - node (v9.0.0, x64)
  • TFS - node (v9.0.0, x86)
Benchmark Name Iterations
Current 33150 10
Baseline master 10

Copy link
Member

@ahejlsberg ahejlsberg left a comment

Choose a reason for hiding this comment

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

Approved assuming perf tests are good.

@ahejlsberg
Copy link
Member

Hmm, that perf run definitely looks odd. Seems like everything slowed down by 5-7%.

@weswigham
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 4, 2019

Heya @weswigham, I've started to run the perf test suite on this PR at b86c86d. You can monitor the build here. It should now contribute to this PR's status checks.

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..33150

Metric master 33150 Delta Best Worst
Angular - node (v12.1.0, x64)
Memory used 325,570k (± 0.02%) 325,891k (± 0.03%) +321k (+ 0.10%) 325,651k 326,118k
Parse Time 1.60s (± 1.97%) 1.59s (± 0.51%) -0.01s (- 0.50%) 1.57s 1.60s
Bind Time 0.82s (± 0.91%) 0.82s (± 0.93%) -0.00s (- 0.49%) 0.81s 0.84s
Check Time 4.50s (± 0.74%) 4.45s (± 0.76%) -0.05s (- 1.05%) 4.38s 4.55s
Emit Time 5.59s (± 0.83%) 5.55s (± 0.62%) -0.04s (- 0.68%) 5.48s 5.65s
Total Time 12.50s (± 0.72%) 12.40s (± 0.27%) -0.10s (- 0.79%) 12.33s 12.46s
Monaco - node (v12.1.0, x64)
Memory used 345,920k (± 0.01%) 345,924k (± 0.02%) +4k (+ 0.00%) 345,774k 346,062k
Parse Time 1.33s (± 1.97%) 1.32s (± 0.61%) -0.01s (- 0.75%) 1.30s 1.33s
Bind Time 0.73s (± 2.32%) 0.72s (± 0.94%) -0.01s (- 0.82%) 0.71s 0.74s
Check Time 4.51s (± 0.50%) 4.54s (± 0.59%) +0.03s (+ 0.67%) 4.48s 4.59s
Emit Time 3.02s (± 0.73%) 3.05s (± 0.62%) +0.02s (+ 0.79%) 3.02s 3.09s
Total Time 9.59s (± 0.34%) 9.63s (± 0.47%) +0.04s (+ 0.40%) 9.52s 9.72s
TFS - node (v12.1.0, x64)
Memory used 301,363k (± 0.02%) 301,433k (± 0.01%) +70k (+ 0.02%) 301,344k 301,526k
Parse Time 1.03s (± 0.90%) 1.03s (± 0.90%) +0.00s (+ 0.00%) 1.01s 1.06s
Bind Time 0.67s (± 1.05%) 0.67s (± 1.04%) +0.00s (+ 0.30%) 0.65s 0.68s
Check Time 4.08s (± 0.57%) 4.11s (± 0.54%) +0.04s (+ 0.91%) 4.07s 4.16s
Emit Time 3.11s (± 0.84%) 3.11s (± 0.74%) +0.00s (+ 0.13%) 3.08s 3.19s
Total Time 8.88s (± 0.48%) 8.92s (± 0.46%) +0.04s (+ 0.50%) 8.86s 9.04s
Angular - node (v8.9.0, x64)
Memory used 344,257k (± 0.02%) 344,514k (± 0.01%) +257k (+ 0.07%) 344,403k 344,601k
Parse Time 2.07s (± 0.71%) 2.09s (± 0.73%) +0.02s (+ 0.97%) 2.06s 2.12s
Bind Time 0.86s (± 1.31%) 0.87s (± 1.03%) +0.01s (+ 0.58%) 0.85s 0.89s
Check Time 5.36s (± 0.99%) 5.37s (± 0.71%) +0.01s (+ 0.13%) 5.28s 5.43s
Emit Time 6.46s (± 1.54%) 6.50s (± 0.90%) +0.03s (+ 0.50%) 6.38s 6.65s
Total Time 14.76s (± 0.67%) 14.82s (± 0.62%) +0.06s (+ 0.41%) 14.64s 15.04s
Monaco - node (v8.9.0, x64)
Memory used 363,667k (± 0.01%) 363,747k (± 0.02%) +80k (+ 0.02%) 363,641k 363,887k
Parse Time 1.63s (± 0.65%) 1.63s (± 0.54%) +0.01s (+ 0.43%) 1.61s 1.65s
Bind Time 0.93s (± 0.88%) 0.94s (± 0.69%) +0.01s (+ 1.19%) 0.92s 0.95s
Check Time 5.45s (± 1.48%) 5.43s (± 1.07%) -0.02s (- 0.44%) 5.34s 5.61s
Emit Time 3.39s (± 4.21%) 3.45s (± 3.47%) +0.07s (+ 1.98%) 3.13s 3.60s
Total Time 11.39s (± 0.88%) 11.45s (± 0.64%) +0.06s (+ 0.54%) 11.22s 11.60s
TFS - node (v8.9.0, x64)
Memory used 317,611k (± 0.01%) 317,661k (± 0.01%) +51k (+ 0.02%) 317,561k 317,753k
Parse Time 1.31s (± 0.44%) 1.32s (± 0.73%) +0.01s (+ 0.61%) 1.29s 1.33s
Bind Time 0.83s (± 4.18%) 0.82s (± 5.92%) -0.01s (- 1.69%) 0.69s 0.87s
Check Time 4.62s (± 1.20%) 4.68s (± 1.31%) +0.06s (+ 1.30%) 4.59s 4.87s
Emit Time 3.29s (± 0.93%) 3.27s (± 0.60%) -0.01s (- 0.37%) 3.23s 3.32s
Total Time 10.05s (± 0.77%) 10.09s (± 0.37%) +0.04s (+ 0.40%) 9.99s 10.15s
Angular - node (v8.9.0, x86)
Memory used 195,033k (± 0.02%) 195,159k (± 0.02%) +127k (+ 0.06%) 195,074k 195,214k
Parse Time 2.02s (± 0.94%) 2.02s (± 0.90%) +0.00s (+ 0.15%) 1.99s 2.08s
Bind Time 0.99s (± 0.59%) 0.99s (± 0.45%) +0.00s (+ 0.10%) 0.98s 1.00s
Check Time 4.85s (± 0.63%) 4.86s (± 0.50%) +0.01s (+ 0.12%) 4.79s 4.90s
Emit Time 6.19s (± 1.71%) 6.21s (± 0.56%) +0.02s (+ 0.34%) 6.15s 6.30s
Total Time 14.05s (± 0.90%) 14.08s (± 0.46%) +0.03s (+ 0.24%) 13.98s 14.25s
Monaco - node (v8.9.0, x86)
Memory used 203,215k (± 0.03%) 203,222k (± 0.02%) +8k (+ 0.00%) 203,140k 203,285k
Parse Time 1.69s (± 0.62%) 1.68s (± 0.45%) -0.01s (- 0.71%) 1.66s 1.69s
Bind Time 0.75s (± 0.77%) 0.75s (± 1.15%) -0.00s (- 0.13%) 0.74s 0.78s
Check Time 5.17s (± 0.57%) 5.15s (± 0.62%) -0.02s (- 0.41%) 5.11s 5.25s
Emit Time 3.36s (± 1.00%) 3.36s (± 0.62%) -0.00s (- 0.00%) 3.31s 3.42s
Total Time 10.97s (± 0.48%) 10.94s (± 0.27%) -0.03s (- 0.31%) 10.88s 11.00s
TFS - node (v8.9.0, x86)
Memory used 178,495k (± 0.01%) 178,516k (± 0.02%) +21k (+ 0.01%) 178,426k 178,614k
Parse Time 1.36s (± 0.49%) 1.37s (± 0.95%) +0.01s (+ 0.81%) 1.35s 1.41s
Bind Time 0.67s (± 0.71%) 0.67s (± 0.89%) -0.00s (- 0.15%) 0.65s 0.68s
Check Time 4.57s (± 0.72%) 4.54s (± 0.56%) -0.03s (- 0.59%) 4.48s 4.59s
Emit Time 3.01s (± 0.71%) 3.00s (± 1.10%) -0.01s (- 0.33%) 2.92s 3.06s
Total Time 9.61s (± 0.40%) 9.58s (± 0.52%) -0.02s (- 0.25%) 9.49s 9.71s
Angular - node (v9.0.0, x64)
Memory used 343,862k (± 0.02%) 344,154k (± 0.01%) +292k (+ 0.08%) 344,005k 344,215k
Parse Time 1.80s (± 0.29%) 1.81s (± 0.70%) +0.01s (+ 0.44%) 1.78s 1.83s
Bind Time 0.81s (± 0.58%) 0.82s (± 1.20%) +0.00s (+ 0.62%) 0.80s 0.84s
Check Time 5.05s (± 0.45%) 5.06s (± 0.43%) +0.01s (+ 0.16%) 5.01s 5.10s
Emit Time 6.06s (± 1.63%) 6.07s (± 1.97%) +0.01s (+ 0.18%) 5.76s 6.23s
Total Time 13.72s (± 0.69%) 13.76s (± 0.80%) +0.03s (+ 0.23%) 13.49s 13.94s
Monaco - node (v9.0.0, x64)
Memory used 363,378k (± 0.01%) 363,444k (± 0.02%) +66k (+ 0.02%) 363,297k 363,560k
Parse Time 1.39s (± 0.61%) 1.38s (± 0.34%) -0.01s (- 0.58%) 1.37s 1.39s
Bind Time 0.87s (± 0.67%) 0.86s (± 0.88%) -0.00s (- 0.35%) 0.85s 0.89s
Check Time 5.46s (± 0.57%) 5.47s (± 0.67%) +0.01s (+ 0.20%) 5.41s 5.59s
Emit Time 3.05s (± 0.63%) 3.06s (± 0.54%) +0.02s (+ 0.56%) 3.04s 3.11s
Total Time 10.76s (± 0.42%) 10.78s (± 0.43%) +0.02s (+ 0.19%) 10.71s 10.92s
TFS - node (v9.0.0, x64)
Memory used 317,419k (± 0.01%) 317,444k (± 0.01%) +25k (+ 0.01%) 317,351k 317,541k
Parse Time 1.09s (± 0.30%) 1.10s (± 0.47%) +0.01s (+ 0.83%) 1.09s 1.11s
Bind Time 0.66s (± 0.88%) 0.66s (± 0.91%) -0.00s (- 0.15%) 0.64s 0.67s
Check Time 4.64s (± 0.33%) 4.65s (± 0.29%) +0.01s (+ 0.15%) 4.61s 4.68s
Emit Time 3.36s (± 0.58%) 3.36s (± 0.67%) -0.01s (- 0.21%) 3.32s 3.43s
Total Time 9.75s (± 0.30%) 9.76s (± 0.34%) +0.01s (+ 0.08%) 9.69s 9.85s
Angular - node (v9.0.0, x86)
Memory used 195,134k (± 0.01%) 195,285k (± 0.02%) +152k (+ 0.08%) 195,182k 195,369k
Parse Time 1.72s (± 0.55%) 1.73s (± 0.88%) +0.01s (+ 0.58%) 1.71s 1.79s
Bind Time 0.94s (± 0.79%) 0.94s (± 0.55%) -0.00s (- 0.21%) 0.93s 0.95s
Check Time 4.52s (± 0.57%) 4.53s (± 0.30%) +0.01s (+ 0.29%) 4.50s 4.56s
Emit Time 5.83s (± 0.75%) 5.85s (± 1.06%) +0.02s (+ 0.33%) 5.78s 6.04s
Total Time 13.02s (± 0.38%) 13.07s (± 0.40%) +0.05s (+ 0.35%) 12.99s 13.20s
Monaco - node (v9.0.0, x86)
Memory used 203,234k (± 0.01%) 203,268k (± 0.01%) +34k (+ 0.02%) 203,179k 203,326k
Parse Time 1.42s (± 0.59%) 1.43s (± 0.59%) +0.01s (+ 0.99%) 1.41s 1.45s
Bind Time 0.69s (± 1.28%) 0.68s (± 1.11%) -0.00s (- 0.44%) 0.67s 0.71s
Check Time 4.98s (± 0.55%) 4.98s (± 0.42%) +0.00s (+ 0.02%) 4.93s 5.01s
Emit Time 3.24s (± 0.47%) 3.26s (± 0.58%) +0.02s (+ 0.52%) 3.23s 3.32s
Total Time 10.32s (± 0.30%) 10.35s (± 0.30%) +0.03s (+ 0.28%) 10.29s 10.44s
TFS - node (v9.0.0, x86)
Memory used 178,563k (± 0.03%) 178,586k (± 0.03%) +23k (+ 0.01%) 178,495k 178,709k
Parse Time 1.13s (± 0.64%) 1.13s (± 0.93%) -0.01s (- 0.44%) 1.11s 1.15s
Bind Time 0.61s (± 0.73%) 0.61s (± 1.11%) +0.00s (+ 0.33%) 0.60s 0.63s
Check Time 4.39s (± 0.38%) 4.39s (± 0.48%) +0.00s (+ 0.05%) 4.35s 4.43s
Emit Time 2.92s (± 0.54%) 2.94s (± 0.58%) +0.01s (+ 0.44%) 2.91s 2.98s
Total Time 9.06s (± 0.25%) 9.07s (± 0.34%) +0.01s (+ 0.15%) 9.00s 9.13s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-161-generic
Architecturex64
Available Memory16 GB
Available Memory14 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
  • node (v9.0.0, x64)
  • node (v9.0.0, x86)
Scenarios
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Angular - node (v9.0.0, x64)
  • Angular - node (v9.0.0, x86)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • Monaco - node (v9.0.0, x64)
  • Monaco - node (v9.0.0, x86)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
  • TFS - node (v9.0.0, x64)
  • TFS - node (v9.0.0, x86)
Benchmark Name Iterations
Current 33150 10
Baseline master 10

@weswigham
Copy link
Member Author

@typescript-bot cherry-pick this into release-3.6

@weswigham weswigham merged commit a932986 into microsoft:master Sep 6, 2019
typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Sep 6, 2019
Component commits:
b86c86d Add heuristic for extracting irreducible `null` and `undefined` types from intersections of unions
@typescript-bot
Copy link
Collaborator

Hey @weswigham, I've opened #33285 for you.

weswigham pushed a commit that referenced this pull request Sep 6, 2019
Component commits:
b86c86d Add heuristic for extracting irreducible `null` and `undefined` types from intersections of unions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expression produces a union type that is too complex to represent
4 participants