3 ms·
Clojure's motivating reasons for immutability are around correctness, not speed. In typical Clojure, immutable data structures are somewhat slower (25%-100%) th
by arohner 11y ago
Clojure's motivating reasons for immutability are around correctness, not speed. In typical Clojure, immutable data structures are somewhat slower (25%-100%) than standard java, but make up for it because they can be trivially parallelized, don't require locking, and are significantly easier to reason about.
From that perspective, immutable structures should be the default, with mutable structures being reserved for when they're truly needed.
- jsprogrammer 11y agoMutable structures should be optimizations of immutable implementations.
- arohner 11y agoThey are! http://clojure.org/transients http://clojure.org/transients