Nicolas Oury 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? > I don't think it's explicitly mentioned in the docs, but you need to hint the array using some rather gruesome syntax. See http://clj-me.blogspot.com/2009/08/what-warn-on-reflection-didnt-tell-you.html
Most likely #^objects will be available in the next version of Clojure. :) -- Jarkko --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---