Micro Benchmarks versus Macro Optimizations in Clojure
Here’s a simple question Clojure users hear often: What is the overhead of Clojure’s persistent data structures? I ran into this question headlong when profiling and tuning Clara. Clara aims to draw ideas from expert systems into the Clojure ecosystem, making them available as first-class Clojure idioms. Therefore Clara’s working memory works like other Clojure data structures: it is immutable and “updates” create a new, immutable working memory.
Too Much Code