9 ms·
> Due to ClojureScript’s immutable data structures, there’s a lot of objects created and garbage collected all the time ^ From the article, sounds like a plaus
by badestrand 5y ago
> Due to ClojureScript’s immutable data structures, there’s a lot of objects created and garbage collected all the time
^ From the article, sounds like a plausible cause for the speed difference.
- fnordsensei 5y agoIt's almost certainly part of it. I doubt that a ClojureScript application written mutably (which you can do) would compare favorably to WASM regardless.
- sickill 5y agoBefore attempting JS/Rust rewrite I tried using transients [0]. I converted small part of the vt code to use mutable data structures to see if it's giving any improvements. It barely did, the difference was negligible. I believe it was because I didn't go all the way, so the perf critical pieces deep down were still using immutable data structures. Maybe it would bring decent improvement if I converted most of the vt code to transients, but it would absolutely destroy the idiomatic aspect of the code, and even then it would never compete with Rust anyway. [0] https://clojure.org/reference/transients https://clojure.org/reference/transients
- fnordsensei 5y agoI get that. And then you'd have to find a way to get rid of React (and Reagent/whatever was used on top of it) to get it all the way to as lean as possible. At this point, you'd be leveraging almost nothing that ClojureScript brings to the table, while getting most of the cons.
- sickill 5y agoSpot on.