You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This breaks glimmer, and thereby our RWC (once sufficiently fixed in other ways)
Code
Isolated repro (needs dom lib for ElementTagNameMap and associated types):
exportfunctionassertIsElement(node: Node|null): node is Element{letnodeType=node===null ? null : node.nodeType;returnnodeType===1;}exportfunctionassertNodeTagName<TextendskeyofElementTagNameMap,UextendsElementTagNameMap[T]>(node: Node|null,tagName: T): node is U{if(assertIsElement(node)){constnodeTagName=node.tagName.toLowerCase();returnnodeTagName===tagName;}returnfalse;}exportfunctionassertNodeProperty<TextendskeyofElementTagNameMap,PextendskeyofElementTagNameMap[T],VextendsHTMLElementTagNameMap[T][P]>(node: Node|null,tagName: T,prop: P,value: V){if(assertNodeTagName(node,tagName)){node[prop];}}
Expected behavior:
No crash.
Actual behavior:
OOM crash after a very long delay.
Preliminary investigation shows the OOM occurs when we try to get the distributed form of keyof <Large Union> - namely the process is defined recursively, so when the union has ~170 members, we create 170 intermediate types (flattening one member at a time, while also wasting time recalculating type flags and other bits we will never need) before getting the final, distributed result. Now, picture doing this on every relation comparison operation for P (this distribution is uncached), and multiplying it for V in assertNodeProperty - the complexity is huge.
cc @DanielRosenwasser since I think you care about when we break glimmer.
The text was updated successfully, but these errors were encountered:
This breaks
glimmer
, and thereby our RWC (once sufficiently fixed in other ways)Code
Isolated repro (needs
dom
lib forElementTagNameMap
and associated types):Expected behavior:
No crash.
Actual behavior:
OOM crash after a very long delay.
Preliminary investigation shows the OOM occurs when we try to get the distributed form of
keyof <Large Union>
- namely the process is defined recursively, so when the union has ~170 members, we create 170 intermediate types (flattening one member at a time, while also wasting time recalculating type flags and other bits we will never need) before getting the final, distributed result. Now, picture doing this on every relation comparison operation forP
(this distribution is uncached), and multiplying it forV
inassertNodeProperty
- the complexity is huge.cc @DanielRosenwasser since I think you care about when we break glimmer.
The text was updated successfully, but these errors were encountered: