On Sat, Nov 6, 2010 at 11:25 PM, André Thieme <splendidl...@googlemail.com> wrote: > Am 06.11.2010 12:57, schrieb philip schwarz: >> >> Hi all, >> >> be gentle please: I have only just started using clojure. >> >> I run the following on an Intel Core 2 Duo CPU (starting clojure with >> "java -Xms1000m -Xmx1000m -jar clojure.jar"): >> >> user=> (time (nth (doall (map inc (range 10000000))) 9999999)) >> "Elapsed time: 5944.068355 msecs" >> 10000000 >> >> user=> (time (nth (doall (pmap inc (range 10000000))) 9999999)) >> "Elapsed time: 108837.451146 msecs" >> 10000000 >> >> I was expecting pmap to take less time then map, instead it took much >> much longer. >> >> Any thoughts? > > Try > (time (count (map (fn [_] (Thread/sleep 1)) (range 1000)))) > vs. > (time (count (pmap (fn [_] (Thread/sleep 1)) (range 1000)))) > > On my system this is 1002 msecs vs. 39 msecs.
Your system has TWENTY-FIVE CORES?! -- 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