On Aug 11, 12:39 am, Andy Fingerhut <andy_finger...@alum.wustl.edu>
wrote:
> 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/9dc56d8ff53f0b8...
>
> Still almost 11 times slower than the Java version, but a lot more
> respectable than my earlier attempts.

Hmmm....

I just ran your version #8, and it's almost as slow as mine
(nbody_v2.clj): 53 times slower than Java, but I'm running Clojure 1.0
and

java version "1.6.0_0"
OpenJDK  Runtime Environment (build 1.6.0_0-b11)
OpenJDK Client VM (build 1.6.0_0-b11, mixed mode, sharing)

Are you aware, by the way, that the "steady-state" Java runs 21 times
instead of once, so you have to divide its time?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to