Johann: Could it be that your CPU has a single floating-point unit shared by 4 cores on a single die, and thus only 2 floating-point units total for all 8 of your cores? If so, then that fact, plus the fact that each core has its own separate ALU for integer operations, would seem to explain the results you are seeing. I see similar results on my 2- core Intel Core 2 Duo when running your test.
I tried to check out that possibility by doing some searches on the Internet about the Xeon, but couldn't quickly find a definitive answer. I'm hoping someone else on the group might know the answer off the top of their head. Andy On Aug 4, 1:59 am, Johann Kraus <johann.kr...@gmail.com> wrote: > > My guess would be you're seeing the overhead for pmap since the > > (inc 0.1) computation is so cheap. From the docs for pmap: > > "Only useful for computationally intensive functions where the time of > > f dominates the coordination overhead." > > I don't think so, as the cheap computation (inc 0.1) is packed into > the long running (dotimes). And it does work for using (inc 0), where > I get a perfect linear speedup. Just by using (inc 0.1) instead of > (inc 0) the speedup is rapidly getting down while the CPU load is next > to the limit. > > > Maybe try this with something more expensive to compute? Also, making > > the result a function of the parameter can't hurt since there's a chance > > the JVM may optimize away the inc of a constant as it stands. > > I also would expect the JVM to optimize away something, but for me it > seems it does not, because again in case of (inc 0) everything works > perfect. > > The point is: > Why do I get a linear speedup with (inc 0) -> 8 times and not with > (inc 0.1) -> 2 times, while the CPU load is 800% and 700%, > respectively? > __ > Johann --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---