2017-03-06 12:06 GMT+01:00 'bertschi' via Clojure <clojure@googlegroups.com>:
> From the docs it says "Allows for more concurrency than (ref-set ref @ref)". > I would read that as "runs at least as fast as (ref-set ref @ref)", but > using (ref-set dogs @dogs) instead of (ensure dogs) and the same with cats, > does not exhibit these occasional runtime spikes. > > Am I misunderstanding something or is it a bug in ensure? If ensure does indeed show worse (or not even better) performance than (ref-set ref @ref) in benchmarks, it certainly would go against my understanding of clojure's STM and I'd consider this a bug (since ensure could just be implemented by ref-set for a free performance boost, in this case). To show this behavior and move this along into a ticket, it would be helpful to run those two examples in a microbenchmark runner, like criterium and attach a profiler to uncover locking problems and excessive retries, that would likely be the root cause. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.