-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: optimise effects #11569
chore: optimise effects #11569
Conversation
🦋 Changeset detectedLatest commit: 691145c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
It looks like all the |
In fact, if we remove
|
Opened #11570 on top of this |
Noticed this while reviewing recently merged PRs. @dummdidumm realised in https://github.com/sveltejs/svelte/pull/11560/files#r1597502682 that we're doing unnecessary work in a loop.
It turns out we can go further — we don't need the
filter_flags & EFFECT
stuff at all, becauseeffects
only contains effects with that flag. And since the only time we don't want to process effects recursively is insideflush_local_render_effects
(whenEFFECT
effects are excluded), these two conditions are in fact synonymous:And
shallow
is only used negatively, so rather than doing!shallow
everywhere we should save ourselves the unnecessary instruction by doingrecursive
instead.The resulting code is somewhat clearer in my eyes.