The amount of work in each element of the pmap is so small that the overhead 
per element is dominating the CPU usage, e.g. overhead like constructing a 
future for each element of the collection you are mapping over.  Try a test 
case where the computation being done in the function you supply to map is a 
lot more than inc.

Note that total CPU time for pmap will always have some extra overhead above 
the corresponding map - it is recommended to use it when that extra overhead is 
small compared to the total computation time required.

Andy

Sent from my iPhone

On Nov 6, 2010, at 4:57 AM, philip schwarz 
<philip.johann.schw...@googlemail.com> wrote:

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

Reply via email to