Not an expert but from Michal Marczyk (much more expert than me ;) never use dorun better doseq because it's chunck aware
More details here http://lanyrd.com/2013/euroclojure/scrdmx/ http://teropa.info/blog/2013/10/15/into-reduce-transient.html Hope it helps. On Thursday, 17 October 2013 04:34:18 UTC+2, Pradeep Gollakota wrote: > > Hi All, > > I’m (very) new to clojure (and loving it)… and I’m trying to wrap my head > around how to correctly choose doseq vs dorun for my particular use case. > I’ve read this earlier post > https://groups.google.com/forum/#!msg/clojure/8ebJsllH8UY/mXtixH3CRRsJand I > had a clarifying question. > > From what I gathered in the above post, it’s more efficient to use doseq > instead of dorun since map creates another seq. However, if the fn you want > to apply on the seq can be parallelized, doseq wouldn’t give you the > ability to parallelize. With dorun you can use pmap instead of map and get > parallelization. > > (doseq [i some-lazy-seq] side-effect-fn) > (dorun (pmap side-effect-fn some-lazy-seq)) > > What is the idiomatic way of parallelizing a computation on a lazy seq? > > Thanks, > Pradeep > -- -- 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/groups/opt_out.