mirror of https://github.com/sveltejs/svelte
perf: make async blocker analysis linear (#18549)
`trace_references` recreated a fresh seen set for every CallExpression, so `touch` re-walked the same transitive assignment graph once per call. For N calls reaching an N-deep binding chain, this was $O(N^2)$. Share one seen set per trace_references invocation. Use separate sets for the write-directed CallExpression touches and the read-directed ReturnStatement touches. The shared set ensures each assignment-value expression is walked at most once, making the traversal linear. `touch` only ever adds to a fixed target set, so skipping an already-seen expression never drops a binding: compiler output is byte-identical. Complements #18548. --------- Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>pull/18537/merge
parent
950e2a837c
commit
545205b420
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
perf: make async blocker analysis scale linearly with the number of top-level references
|
||||
Loading…
Reference in new issue