mirror of https://github.com/sveltejs/svelte
perf: store current_sources as Set for O(1) membership checks (#18278)
`current_sources` tracks the sources created within the active reaction so that reading or writing them during that same reaction doesn't trigger a re-run. It was an `Array` checked with `Array.prototype.includes.call(...)` in three hot places: the `state_unsafe_mutation` guard, `set()`'s destruction check, and `schedule_possible_effect_self_invalidation`. --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/18265/merge
parent
0bb715d3cf
commit
67090e8ee8
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
perf: store `current_sources` as a `Set` for O(1) membership checks
|
||||
Loading…
Reference in new issue