On Tuesday, June 3, 2014 12:46:55 PM UTC-5, Mars0i wrote:
>
> (def ones (doall (repeat 1000 1)))
> (bench (def _ (doall (map rand ones))))   ; 189 microseconds average time
> (bench (def _ (doall (pmap rand ones))))  ; 948 microseconds average time
>

For the record, I worried later that rand was too inexpensive, and that 
those results were being driven only by the cost of setting up threads in 
pmap.  This seems like a better test:

(bench (def _ (doall (map #(nth (iterate rand %) 10000) (repeat 256 1)))))
; 185 milliseconds average time

(bench (def _ (doall (pmap #(nth (iterate rand %) 10000) (repeat 256 1)))))
; 793 milliseconds average time

I have been having success getting a speedup simply by changing certain map 
calls to pmap in my main project.  I'm sure that many of us will be 
interested in a report whenever you get to it, but I can easily imagine 
that finding the time to summarize what you've learned is difficult. 

-- 
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.

Reply via email to