Error on excessive relation complexity#55851
Conversation
# Conflicts: # src/compiler/diagnosticMessages.json
|
@typescript-bot test top100 |
|
Heya @ahejlsberg, I've started to run the tsc-only perf test suite on this PR at 89f5d10. You can monitor the build here. Update: The results are in! |
|
Heya @ahejlsberg, I've started to run the diff-based top-repos suite on this PR at 89f5d10. You can monitor the build here. Update: The results are in! |
|
Heya @ahejlsberg, I've started to run the diff-based user code test suite on this PR at 89f5d10. You can monitor the build here. Update: The results are in! |
|
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at 89f5d10. You can monitor the build here. Update: The results are in! |
|
@ahejlsberg Here they are:
CompilerComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@ahejlsberg Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Everything looks good! |
|
@ahejlsberg Here are the results of running the top-repos suite comparing Everything looks good! |
|
Hey @ahejlsberg, the results of running the DT tests are ready. |
|
On PR #50329, @weswigham had proposed a more general form of the optimization found on this PR. What's the reasoning behind picking this simpler form of the optimization instead? |
I hadn't seen #50329, but certainly the optimization in this PR removes far more work when the fast path is available. There's no reason the two couldn't co-exist. |
# Conflicts: # src/compiler/diagnosticMessages.json
|
@typescript-bot test top100 |
|
Heya @ahejlsberg, I've started to run the diff-based user code test suite on this PR at be68f32. You can monitor the build here. |
|
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at be68f32. You can monitor the build here. |
|
Heya @ahejlsberg, I've started to run the tsc-only perf test suite on this PR at be68f32. You can monitor the build here. Update: The results are in! |
|
Heya @ahejlsberg, I've started to run the diff-based top-repos suite on this PR at be68f32. You can monitor the build here. Update: The results are in! |
|
@ahejlsberg Here they are:
CompilerComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@ahejlsberg Here are the results of running the top-repos suite comparing Everything looks good! |
With this PR we now error when computing a relation is excessively complex. Specifically, when computing a relation results in adding more relation cache entries than 1/8th of the current capacity of that relation, we issue an error. Relation caches use JavaScript maps, which in Node.js are limited to 2^24 (~16M) entries.
An example of a relation computation that is excessively complex is the following:
Above,
T1is a union with 10,001 members, andT2normalizes to a union with 20,002 members.This PR further implements an optimization outlined here. For example, the following example doesn't cause an excessive complexity error because we now have a fast path when relating a union resulting from normalizing an intersection of large unions to one of those same unions.
Fixes #55630.