Hi, after some fiddling I managed to do some serious optimization by porting calculation to web assembly compiled from Rust. Here’s the wasm version. Oh god, the speed is at least doubled. However, I experience some weird quirks while dragging and local storage stopped working. Maybe it’s because of the service worker I used for a progressive web app? Or is there any race condition between subscriptions and commands back and force between elm, js, and rust? I have trouble locating the issue. Can someone help?
repo: https://github.com/AlienKevin/electric-fields-with-rust
BTW: Now we support simulating electric forces as well.