On Fri, Mar 30, 2012 at 11:01 AM, Larry Travis <tra...@cs.wisc.edu> wrote: > user=> (time (dotimes [i 10] (average1 mill-float-numbs))) > "Elapsed time: 526.674 msecs" > > user=> (time (dotimes [i 10] (average2 mill-float-numbs))) > "Elapsed time: 646.608 msecs" > > user=> (time (dotimes [i 10] (average3 mill-float-numbs))) > "Elapsed time: 405.484 msecs" > > user=> (time (dotimes [i 10] (average4 mill-float-numbs))) > "Elapsed time: 394.31 msecs"
I can understand the first one being "slow" but I'm a bit surprised about the loop being the slowest of the four options. Can someone shed some light on that? Nice to see the accumulating reduce being faster since that's how I've settled in to solving this kind of problem in our code, without really wondering about performance (it's "fast enough" and I think it's the more elegant solution). -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880) -- 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