On Tue, Jun 29, 2010 at 2:05 PM, j-g-faustus <johannes.fries...@gmail.com>wrote:
> OK, I tried this. Object field access instead of arrays made a few > percent difference, but not enough to be significant. > > Definterface and defprotocol, on the other hand, not only gave cleaner > code but was more than twice as fast. A huge win if you ask me :) > > So summarizing this particular benchmark: > * 1.1 style optimization using primitive Java arrays peaks at ~4x > slower than Java. > * 1.2 style optimization using mutable primitive fields in a deftype > is only ~1.7x (70%) slower than Java. > > Links: > * more detail including profiling snapshots, JVM version etc. > http://wiki.github.com/j-g-faustus/Clojure-test-code/ > * 1.2 implementation: > > http://github.com/j-g-faustus/Clojure-test-code/blob/master/shootout/nbody_type.clj > > I haven't tried the new numeric branches, there seems to be a > sufficient number of people with opinions on those already :) > You should give the latest equiv branch a shot and let us know. The gap should be a bit smaller since arithmetic operations won't box their results. David -- 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