On Aug 10, 11:50 pm, Christophe Grand <christo...@cgrand.net> wrote: > Hi Andy, > > On Tue, Aug 11, 2009 at 8:15 AM, Andy Fingerhut < > > andy_finger...@alum.wustl.edu> wrote: > > I've tried an approach like you suggest, using mutable Java arrays of > > doubles, macros using aget / aset-double for reading and writing these > > arrays, and loop/recur everywhere iteration is needed in the inner > > loop. It is here: > > aget-* and aset-* are slow, just use aget and aset with type hints. > > Christophe
Wow, you ain't kiddin. I changed about 10 lines from my last version, to avoid using aset-double, using aset and type hints until the reflection warnings went away, and it sped up by a factor of 10. I'm leaving the previous version's source and results there just so I can have a future reference to point to at the difference it makes. New results here: http://github.com/jafingerhut/clojure-benchmarks/blob/9dc56d8ff53f0b8d363f213317587432bd8793de/RESULTS Still almost 11 times slower than the Java version, but a lot more respectable than my earlier attempts. Should there be a similar warning like *warn-on-reflection* that tells you to avoid using aset-* if you want better performance? Or at least put a loud warning in the doc strings for those functions about their poor performance? Or can they just be removed? Thanks! Andy --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---