Skip to content

perf: skip unmarked effects#18062

Draft
Rich-Harris wants to merge 6 commits intoincremental-batchesfrom
incremental-batches-was-marked
Draft

perf: skip unmarked effects#18062
Rich-Harris wants to merge 6 commits intoincremental-batchesfrom
incremental-batches-was-marked

Conversation

@Rich-Harris
Copy link
Copy Markdown
Member

Companion to #18035, specifically addressing the case mentioned in #18035 (comment) wherein an unmarked effect can be skipped. Sure enough the clean_effects benchmark runs as fast on this branch as on main:

Details
a: incremental-batches-was-marked
b: incremental-batches
c: main

sbench_create_signals
  time: fastest is a (incremental-batches-was-marked)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼    26.30ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 30.91ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 30.93ms
  gc_time: fastest is a (incremental-batches-was-marked)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼        5.23ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼       5.70ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 8.18ms

sbench_create_0to1
  time: fastest is b (incremental-batches)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  5.84ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   5.56ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 6.24ms

sbench_create_1to1
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   20.23ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 22.32ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼     18.29ms
  gc_time: fastest is a (incremental-batches-was-marked)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼     2.32ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼    2.47ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.94ms

sbench_create_2to1
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  17.58ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 18.43ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼     14.37ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  2.39ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.54ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   2.29ms

sbench_create_4to1
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 15.94ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 16.01ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼     12.56ms
  gc_time: fastest is a (incremental-batches-was-marked)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  2.21ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.35ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  2.29ms

sbench_create_1000to1
  time: fastest is a (incremental-batches-was-marked)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 14.43ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 14.57ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 14.61ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.27ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  2.21ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  2.20ms

sbench_create_1to2
  time: fastest is a (incremental-batches-was-marked)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 8.97ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 9.03ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 9.16ms

sbench_create_1to4
  time: fastest is b (incremental-batches)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  8.42ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  8.39ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 8.64ms
  gc_time: fastest is b (incremental-batches)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 0.84ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  0.79ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 0.83ms

sbench_create_1to8
  time: fastest is b (incremental-batches)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 6.98ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  6.63ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 6.97ms

sbench_create_1to1000
  time: fastest is b (incremental-batches)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 7.31ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  6.89ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 7.36ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 0.22ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   0.20ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   0.20ms

clean_effects_owned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼           119.59ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 244.76ms
    c: ◼◼◼◼◼◼◼◼◼            116.24ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  0.54ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 0.56ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   0.51ms

clean_effects_unowned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼           118.41ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 239.77ms
    c: ◼◼◼◼◼◼◼◼◼◼           115.19ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼     0.47ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 0.59ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼     0.46ms

kairo_avoidable_owned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  1734.51ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 1804.79ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼       1234.31ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  26.61ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 27.49ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   24.24ms

kairo_avoidable_unowned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  1708.58ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 1812.38ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼        1211.52ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  27.05ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 27.87ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼    24.21ms

kairo_broad_owned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2340.05ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2382.86ms
    c: ◼◼◼◼◼◼               669.43ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  9.10ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 9.70ms
    c: ◼◼◼◼◼◼◼◼             3.74ms

kairo_broad_unowned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  2340.34ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2425.44ms
    c: ◼◼◼◼◼◼               673.85ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  9.52ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 10.20ms
    c: ◼◼◼◼◼◼◼              3.69ms

kairo_deep_owned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   885.58ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 958.43ms
    c: ◼◼◼◼◼◼               270.71ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  4.68ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 4.82ms
    c: ◼◼◼◼◼                1.24ms

kairo_deep_unowned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   858.00ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 949.56ms
    c: ◼◼◼◼◼◼               266.72ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 4.67ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 4.75ms
    c: ◼◼◼◼◼                1.28ms

kairo_diamond_owned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  1553.11ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 1674.34ms
    c: ◼◼◼◼◼◼◼◼◼◼           809.91ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 16.96ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  16.48ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼      12.66ms

kairo_diamond_unowned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  1547.29ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 1647.40ms
    c: ◼◼◼◼◼◼◼◼◼◼           798.98ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 16.11ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 16.09ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼     13.26ms

kairo_mux_owned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   938.67ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 1036.29ms
    c: ◼◼◼◼◼◼◼              386.34ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.50ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.54ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼         1.50ms

kairo_mux_unowned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  942.81ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 997.44ms
    c: ◼◼◼◼◼◼◼◼             385.21ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.30ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.25ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼       1.56ms

kairo_repeated_owned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 207.47ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 211.22ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼       152.75ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  2.13ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.22ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  2.06ms

kairo_repeated_unowned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  202.64ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 208.58ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼       149.51ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.20ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.25ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   1.98ms

kairo_triangle_owned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼    502.24ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 591.87ms
    c: ◼◼◼◼◼◼◼              218.83ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.82ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.79ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼         2.27ms

kairo_triangle_unowned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼     485.65ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 592.93ms
    c: ◼◼◼◼◼◼◼              214.54ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.86ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  3.68ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼         2.25ms

kairo_unstable_owned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  281.22ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 302.58ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼         185.37ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.39ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.39ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼     1.95ms

kairo_unstable_unowned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   278.06ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 302.79ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼         182.60ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 2.58ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  2.50ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼      1.89ms

mol_owned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 35.90ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 36.31ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   33.14ms

mol_unowned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 35.43ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 36.05ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼   32.88ms

repeated_deps_owned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 323.07ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 328.87ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼        215.58ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.56ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  3.37ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼    3.06ms

repeated_deps_unowned
  time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  315.27ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 328.88ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼        213.51ms
  gc_time: fastest is c (main)
    a: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.42ms
    b: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ 3.46ms
    c: ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼  3.36ms


Some other tests are still a fair bit slower. More importantly, a bunch of tests are failing, because it turns out cache invalidation really is one of the two hard problems in computer science.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 4, 2026

⚠️ No Changeset found

Latest commit: 07f1480

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svelte-docs-bot
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

Playground

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

@Rich-Harris Rich-Harris changed the title Incremental batches was marked perf: skip unmarked effects Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant