layerchart icon indicating copy to clipboard operation
layerchart copied to clipboard

[ForceSimulation] Svelte 5 performance regressions

Open techniq opened this issue 10 months ago • 1 comments

Sometime during the Svelte 5 releases, performance of the ForceSimulation has deteriorated.

When the docs were originally migrated to [email protected] in Oct 2024, performance was consistent (from a user feel) with svelte@4 (example).

There have been some reactivity changes around 5.19.5 that caused some regressions but not sure if it's related.

There are plans in Svelte to provide better integration with managing state from external sources (ex. d3-force) such as $state.opaque, but it was recently determined the ergonomics of this approach were not right. The maintainers still plan to introduce a solution.

techniq avatar Mar 12 '25 11:03 techniq

Tested @[email protected] from an older PR preview and it's worse than 5.0.2 but not as bad as the current 5.20.4 depending on the example (force lattice is typically the worst, likely due to the number of nodes)

techniq avatar Mar 12 '25 11:03 techniq

[email protected] has been released which greatly improves Svelte 5 performance

techniq avatar May 05 '25 03:05 techniq