Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: removeUNOWNED flag#17105

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dummdidumm merged 29 commits intomainfromremove-unowned
Nov 6, 2025
Merged

chore: removeUNOWNED flag#17105

dummdidumm merged 29 commits intomainfromremove-unowned
Nov 6, 2025

Conversation

@Rich-Harris
Copy link
Member

@Rich-HarrisRich-Harris commentedNov 3, 2025
edited by dummdidumm
Loading

This makes good on my threat in#17102 (comment) to sort out all the convoluted nonsense aroundUNOWNED andDISCONNECTED deriveds. We've made this far more complicated than it needs to be. All we need to do is push the current signal to its dependencies'reactions when the signal is connected to the graph, and skip doing so when it isn't.

Fixes#17024
Fixes#17049 (comment) (and therefore everything that was still buggy in that issue I think)

Most benchmarks are unaffected, but where thereis a significant effect, this branch is much faster.

results of `pnpm bench:compare`
sbench_create_signals  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 367.63ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 373.89ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 160.79ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 164.47mssbench_create_0to1  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 6.16ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  5.93mssbench_create_1to1  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 21.26ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 21.05ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.02ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.96mssbench_create_2to1  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 18.48ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 18.42ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  2.92ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.00mssbench_create_4to1  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 17.03ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 16.77ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.01ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.97mssbench_create_1000to1  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 14.87ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 14.95ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.85ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.91mssbench_create_1to2  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 10.63ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 10.59ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 0.77ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   0.71mssbench_create_1to4  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 8.72ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 8.82ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  0.51ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 0.54mssbench_create_1to8  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 7.42ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  7.21mssbench_create_1to1000  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 8.60ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 8.57ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  0.63ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 0.67mskairo_avoidable_owned  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 513.85ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 511.03ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  36.68ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 38.50mskairo_avoidable_unowned  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼     499.87ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 612.69ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  36.09ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 38.70mskairo_broad_owned  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 501.31ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 499.64ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 4.13ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   3.68mskairo_broad_unowned  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 499.73ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 498.98ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 4.11ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   3.71mskairo_deep_owned  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 218.20ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 214.63ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.82ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.78mskairo_deep_unowned  time: fastest is a (remove-unowned)    a: ◼◼◼◼                 212.50ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 1011.22ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼      2.86ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.75mskairo_diamond_owned  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 418.69ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 421.05ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 22.13ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 22.09mskairo_diamond_unowned  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼    409.05ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 495.23ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  21.79ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 22.39mskairo_triangle_owned  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 127.22ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 130.11ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  4.06ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 4.18mskairo_triangle_unowned  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼           123.38ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 246.39ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 4.36ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  4.05mskairo_mux_owned  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  328.77ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 345.10ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.90ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.87mskairo_mux_unowned  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼        326.24ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 494.95ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.10ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  3.01mskairo_repeated_owned  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 80.15ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 79.85ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   2.95ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.28mskairo_repeated_unowned  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  75.69ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 78.93ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.53ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   3.20mskairo_unstable_owned  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 120.92ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  117.36ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.95ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  3.84mskairo_unstable_unowned  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   118.29ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 133.75ms  gc_time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.98ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.90msmol_bench_owned  time: fastest is b (main)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 286.63ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 285.10ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 0.93ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 0.94msmol_bench_unowned  time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  286.43ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 304.27ms  gc_time: fastest is a (remove-unowned)    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼    1.01ms    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 1.17ms

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC:https://github.com/sveltejs/rfcs
  • Prefix your PR title withfeat:,fix:,chore:, ordocs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.
  • If this PR changes code withinpackages/svelte/src, add a changeset (npx changeset).

Tests and linting

  • Run the tests withpnpm test and lint the project withpnpm lint

nmontavon, pitzzahh, hyperpuncher, brysonbw, connorjan, and techniq reacted with thumbs up emoji
@changeset-bot
Copy link

changeset-botbot commentedNov 3, 2025
edited
Loading

🦋 Changeset detected

Latest commit:66d6d4b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
sveltePatch

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

@github-actions
Copy link
Contributor

Playground

pnpm add https://pkg.pr.new/svelte@17105

Copy link
Member

@dummdidummdummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This looks promising - what I don't quite understand at the moment is how it's safe that something counts as owned as long as it has any reactions

@Rich-Harris
Copy link
MemberAuthor

There is no concept of ownership any more — something is either connected (in which case it will be notified of changes to its dependencies, and will in turn notify its dependents) or it isn't. We don't need tocare if a derived is owned or not

@Rich-HarrisRich-Harris marked this pull request as ready for reviewNovember 4, 2025 14:24
* fix: delete from batch_values on updatesThis fixes a bug where a derived would still show its old value even after it was indirectly updated again within the same batch. This can for example happen by reading a derived on an effect, then writing to a source in that same effect that makes the derived update, and then read the derived value in a sibling effect - it still shows the old value without the fix.The fix is to _delete_ the value from batch_values, as it's now the newest value across all batches. In order to not prevent breakage on other batches we have to leave the status of deriveds as-is, i.e. within is_dirty and update_derived we cannot update its status. That might be a bit more inefficient as you now have to traverse the graph for each `get` of that derived (it's a bit like they are all disconnected) but we can always optimize that later if need be.Another advantage of this fix is that we can get rid of duplicate logic we had to add about unmarking and reconnecting deriveds, because that logic was only needed for the case where deriveds are read after they are updated, which now no longer hits that if-branch* keep derived cache, but clear it in mark_reactions (#17116)---------Co-authored-by: Rich Harris <rich.harris@vercel.com>
Copy link
Member

@dummdidummdummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Fantastic work

@dummdidummdummdidumm merged commit46e9d2d intomainNov 6, 2025
17 of 18 checks passed
@dummdidummdummdidumm deleted the remove-unowned branchNovember 6, 2025 10:47
@github-actionsgithub-actionsbot mentioned this pull requestNov 6, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dummdidummdummdidummdummdidumm approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Collection of bugs with async svelte & bits-ui & more (in a more "complex app") Rendering issues since 5.41.2

3 participants

@Rich-Harris@dummdidumm

[8]ページ先頭

©2009-2025 Movatter.jp