I would definitely like to have such a reference because I often work with performance-critical code which I mostly delegate to Java. I would like to see it organized in categories for easier access, with commentaries to each case on why is this so (for example, i would suppose that aset-int should be faster in your example, but this is not true). As a recommendation, you could probably use some libraries like https://github.com/ptaoussanis/timbre to produce more sophisticated tests. Also check for existing materials like https://www.youtube.com/watch?v=ii-ajztxALM and such..
Also, afaik, most of Clojure community seem to not be very concerned with performance, so not everyone will be deeply interested, but I and someone else would definitely be. On Sunday, July 14, 2013 12:15:04 PM UTC+4, Marc Dzaebel wrote: > > I'm often in need of performance comparisons/recommendations about > different ways to code the same usecases. E.g. > > (time(let [x 2 y [0 1 2 3 4]] (dotimes [_ 10000000] (remove *#{x}*y)))) > ;~950 ms > (time(let [x 2 y [0 1 2 3 4]] (dotimes [_ 10000000] (remove *#(= % x)*y)))) > ;~150 ms > > (time(let [a (int-array 10)] (dotimes [_ 10000000] (*aset *a 1 > 2)))) ;~7 ms > (time(let [a (int-array 10)] (dotimes [_ 10000000] (*aset-int *a 1 > 2)))) ;~430 ms > > I'd recommend to gather such information at a central place in a more > systematic way. So I wonder: > > - where to place such information > (Wiki?)<http://en.wikibooks.org/wiki/Clojure_Programming> > - whether this information is of use > - whether you have more recommendations regarding performance or the > form, advices are presented > > *Thanks, Marc* > -- -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.