Experiment short-circuiting of union distribution #47511
Labels
Experience Enhancement
Noncontroversial enhancements
Experimentation Needed
Someone needs to try this out to see what happens
Suggestion
An idea for TypeScript
Milestone
Uh oh!
There was an error while loading. Please reload this page.
Suggestion
π Search Terms
union distribute short-circuit performance
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
@amcasey and I were discussing #47481 and he had an interesting observation. Consider this program:
Naively, when evaluating
M
, we need to check if every member ofHugeUnion1
is present inHugeUnion2
. However, let's say we saw this (in the sorted form):After evaluating
"a"
, we have atrue
. After evaluating"q"
, we have afalse
. We can skip the rest of the list since no subsequent result will change the answer (becauseT
does not appear in the conditional result)Moreover, if instead of
false
we hadnever
, we could immediately stop after seeingtrue
, sincetrue | never
is justtrue
The text was updated successfully, but these errors were encountered: