SIGN IN SIGN UP
sveltejs / svelte UNCLAIMED

web development for the rest of us

0 0 69 JavaScript

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>
M
Mathias Picker committed
67090e8ee8a4ac3cb2926969f75cf161ace6367d
Parent: 0bb715d
Committed by GitHub <noreply@github.com> on 5/28/2026, 11:53:13 AM