3 ms·
I don't have a reference for the sentiment, but I do have a couple thoughts on the matter. The first is that I've actively used Clojure on a number of (small)
by mschaef 10y ago
I don't have a reference for the sentiment, but I do have a couple thoughts on the matter.
The first is that I've actively used Clojure on a number of (small) projects, and tend not to have had significant performance issues with the persistent data structures. Where I have run into issues is around laziness, but that's probably a design issue more than anything else. (http://www.ksmpartners.com/2014/01/clojure-lazy-seq-and-the-stackoverflowexception/ http://www.ksmpartners.com/2014/01/clojure-lazy-seq-and-the-...)
Having said that, I do find it very easy to believe that the persistent data structures cause performance problems. A few months ago, I was working on a small search program using ES6 and ImmutableJS. Removing ImmutableJS (and retaining the same number of object copies in my replacement code) resulted in something like a 100-fold increase in performance (making my program fit for the intended purpose.)
I need to do a bit more analysis, but my general thought on the reason why this happened is that the the data structures I was managing were too small for the structure sharing to offer any real benefit. The net result being that the negative performance impact caused by the more complex underlying data structure and API access just swamped whatever gains there were in the faster copying. Of course, for this to become favorable for the persistent data structure, the size of the data would need to be considerably larger. I don't know how common a use case that really is.