Tried the equiv branch briefly: The "1.1 style" version is ~4%
quicker, but still ~4x slower than Java and ~2x slower than mutable
deftype.

But I found another issue: Array access apparently converts primitives
to boxed values at every access. This is perhaps because aget/aset is
a function and primitives cannot cross function boundaries?
That would explain the relative slowness of arrays.

Here is a test case http://gist.github.com/458669
And a profiler screenshot 
http://i589.photobucket.com/albums/ss334/j-g-faustus/profiling/array-test-50k.png

15% CPU time goes to Double.valueOf(double) in all-primitive array
access and another ~4% to intCast(int).

The number of calls to Double.valueOf(double) seems to suggest that it
is called only on aset, not on aget, though I can't think of any
reason how that could be.

Does anyone know more about this?


Regards
jf


On Jun 29, 9:31 pm, David Nolen <dnolen.li...@gmail.com> wrote:
>
> 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

Reply via email to