3 ms·
The drawback here is that the STM (at least the Clojure implementation few years ago when I tested it) is orders of magnitude slower than simple atomic referenc
by eveningcoffee 11y ago
The drawback here is that the STM (at least the Clojure implementation few years ago when I tested it) is orders of magnitude slower than simple atomic reference.
It actually does not have to be, but this is how it is (was) implemented. I built a simple STM (in Java) as part of my bachelor thesis and its performance was comparable to the atomic reference.
- platz 11y agoIf all you need is a simple atomic reference, then great. I'm not convinced a single atomic reference sufficiently covers enough use cases, however.
- eveningcoffee 11y agoYes, it probably does not, and I think that using STM is actually fine in Clojure. Just you have to pay attention to the limitations.