[ForceSimulation] Svelte 5 performance regressions
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.
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)
[email protected] has been released which greatly improves Svelte 5 performance