Lee, My reading of this thread is not quite as pessimistic as yours. Here is my synthesis for the practical application developer in Clojure from reading and re-reading all of the posts above. Marshall and Cameron, please feel free to correct me if I screw anything up here royally. ;-)
When running code in parallel, the fastest to slowest ways to allocate memory via Clojure (of those examined above) are: 1. Java array 2. Java linked list 3. conj onto a transient vector 4. cons onto a list 5. conj onto a vector 6. DO NOT conj onto a list EVER!!! And that's pretty much all there is to it until Marshall figures out how to hack the JVM to overcome this very subtle JIT deoptimization bug relating to polymorphic conj calls on Cons and PersistentList types. Good luck, ~Gary On Tuesday, December 11, 2012 10:37:50 AM UTC-5, Lee wrote: > > On Dec 11, 2012, at 4:37 AM, Marshall Bockrath-Vandegrift wrote: > > I’m not sure what the next steps are. Open a bug on the JVM? This is > > something one can attempt to circumvent on a case-by-case basis, but > > IHMO has significant negative implications for Clojure’s concurrency > > story. > > I've gotten a bit lost in some of the diagnoses and experimental results > and analyses and suggestions -- all of which I really appreciate! -- but > I'm trying to get clear in my mind what the current state of things is from > an application perspective. > > Is the following a fair characterization pending further developments? > > --- > If you have a cons-intensive task then even if it can be divided into > completely independent, long-running subtasks, there is currently no known > way to get significant speedups by running the subtasks on multiple cores > within a single Clojure process. In some cases you will be able to get > significant speedups by separating the subtasks completely and running them > in separate Clojure processes running on separate JVM instances. But the > speedups will be lost (mostly, and you might even experience slowdowns) if > you try to run them from within a single Clojure process. > --- > > Or have I missed a currently-available work-around among the many > suggestions? > > I realize that even if this is the current situation it might change via > fixes on any one of several fronts (and I hope that it does!), but is this > indeed the current situation? > > Thanks so much, > > -Lee -- 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