On Mon, Aug 17, 2009 at 9:25 AM, Bradbev<brad.beveri...@gmail.com> wrote:
>
> On Aug 17, 1:32 am, Nicolas Oury <nicolas.o...@gmail.com> wrote:
>> I was referring to the rules of the benchmark game. When you benchmark
>> language, using another language is not fair.
>>
>> If you were to do your own program, of course you could use Java.
>> However, in the particular circumstance, it is a bit annoying to use
>> Java just to create a data structure type.
>>
> Ah, that makes more sense re the "cheating" then.  Your insight for
> array range check elimination got me thinking - why can't the accessor
> macros (posx, etc) that use aset/aget have their ranges eliminated by
> the JVM?  After all, it should be a simple constant fold.  I found
> another 2-3x speed up by coercing the indexes with (int x), ie
> (defmacro mass [p] `(double (aget ~p (int 0))))

I'm not seeing this. Maybe you are running this on "-client"?

> I don't have the Java version running on my machine, but I saw
> runtimes go from 833ms to 295ms for 100000 iterations, a 2.8x speed
> up, which should put the "no cheating" version on the same standing as
> the Java implementation.

You can't get a consistent timing for anything less than 1-10M iterations here.

--~--~---------~--~----~------------~-------~--~----~
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