This work implements React Compiler uses quadratic array queues in three traversals (open)
Summary
Three breadth-first/worklist traversals dequeue with Array.shift(): queued program functions, HIR reachability shrinking, and control post-dominators. Each dequeue moves every remaining array entry, making the queue portion quadratic on large inputs.
Expected behavior
Queue traversal should advance a cursor over the append-only worklist so every queued item is visited once without repeatedly moving the remainder.
Actual behavior
All three loops repeatedly call shift() until empty. Output order is FIFO, but queue maintenance scales as O(nΒ²).
Version
React Compiler main 2dc7da790d63.
Youβve reached the end
Please mind the merge button