On Tue, Jan 27, 2009 at 9:34 PM, hank williams <hank...@gmail.com> wrote: > > hmm... I'm confused. From the numbers in your example it looks like > server has an advantage by a factor of about 2x. But in your text you > say that the client version has an advantage with complicated code. > What am I missing? Does one JVM have the advantage in one situation > and one in others?
He most likely had them switched around by mistake in the text. The -server VM is much better at optimizing the assembly it produces, but at the cost of increased memory usage and a longer startup time. Java benchmarks are typically run with the -server VM, though the -client VM is sometimes used when comparing startup times and memory usage with other non-Java VMs. > > Hank > > On Tue, Jan 27, 2009 at 3:20 PM, dreish <dresweng...@dreish.org> wrote: >> >> java -server is not the default on Macs. It makes a huge difference >> for Clojure. >> >> % java -jar clojure.jar >> Clojure >> user=> (time (reduce #(+ %1 %2 (if (odd? %1) -1 0)) (range 10000000))) >> "Elapsed time: 11793.18 msecs" >> 49999990000001 >> >> % java -server -jar clojure.jar >> Clojure >> user=> (time (reduce #(+ %1 %2 (if (odd? %1) -1 0)) (range 10000000))) >> "Elapsed time: 6757.651 msecs" >> 49999990000001 >> >> The rough rule I've noticed is that the more complicated the Clojure >> code, the bigger the advantage -client has over -server. >> >> >> On Jan 27, 3:04 am, Keith Bennett <keithrbenn...@gmail.com> wrote: >>> All - >>> >>> I tried testing the code athttp://clojure.org/Refsto see what the >>> benefit of multicore processing would be. To my surprise, the my-pmap >>> function took *more* time, not less, than the map function. >>> >>> Whereas the times listed in the article were approximately 3.1 and 1.7 >>> seconds, on my MacBookPro 2.33 GHz Intel Core 2 Duo laptop, my times >>> were 14.9 and 15.1 seconds. >>> >>> What is the correct interpretation of these results? Does one need >>> more than 2 CPU's to see a benefit? Or is the Mac JVM only using one >>> CPU instead of two? Or...? >>> >>> ...and is there something wrong with my setup that both took so long? >>> >>> Thanks for any enlightenment. >>> >>> - Keith Bennett >> > >> > > > > -- > blog: whydoeseverythingsuck.com > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---