You need to specify the array type. For example the following produces a
primitive array of n javax.vecmath.Vector2d elements.

(defn #^"[Ljavax.vecmath.Vector2d;" point-array [n]
  (make-array javax.vecmath.Vector2d n))

It works. If you want to see it in action take a look at:

http://github.com/swannodette/convex-hull/tree/master

On Sat, Aug 15, 2009 at 11:41 AM, Nicolas Oury <nicolas.o...@gmail.com>wrote:

>
> Dear all,
>
> I try to write a program where I access a java array of non  primitive
> and realize aget is very slow.
> (6x slower than the same program with clojure vectors instead of java
> arrays access)
>
> I tried a few combinations of type hints but can't manage to prevent mty
> program to spend most of its time there:
>
> 99.4%     0  +  8804    java.lang.reflect.Array.get
>
> Does anyone know how to speed that up?
> Is it written somewhere in the java interop documentation?
>
> Best,
>
> Nicolas.
>
>
> >
>

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