On Tue, Aug 18, 2009 at 11:28 AM, Brad
Beveridge<brad.beveri...@gmail.com> wrote:
>
> On 2009-08-17, at 8:58 PM, FFT <fft1...@gmail.com> wrote:
>
>> On Mon, Aug 17, 2009 at 9:25 AM, Bradbev<brad.beveri...@gmail.com>
>> wrote:
>>>
>>> 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'm running Java 1.5 32bit on OS X 10.5 with -server.
>>
>>> 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.
> Why do you think that?  Everything I've read says that hotspot kicks
> in at 10,000, and I always do a warmup run.
> I see consistent enough timings, within 50ms each run. When coerced
> ints gives an immediate 3x speedup something is happening. What JVM
> are you running & what settings?  I'll compile the java version soon
> so I can do a direct compare on a single machine. I take it that your
> setup is showing clojure 3x slower than the java version?
>
> Brad
>

I don't see much of any difference here from those coercions either.
What clojure version are you using?
-- Aaron

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