Measure the performance cost of volatile synchronization of mutable state in stateful transducers, cf CLJ-2146.
fast-transducers.core
defines unsynchronized versions of clojure.core
's transducers relying on volatile!
. The volatile container is replaced with a clojure.lang.Box
, the rest of the code is the same.
Run the benchmark with clojure -Aperf
. Numbers are relative performance improvements of unsynchronized versions w.r.t their respective volatile-synchronized counterparts.