I'm trying to call some third-party code that expects a two-
dimensional double array, and I can't figure out how to create and
fill this in Clojure without a huge perf hit (which profiling shows to
be coming from reflection):

user> (time (let [arr  (make-array Double/TYPE 1)] (dotimes [_ 100000]
(aset-double arr 0 0.0))))
"Elapsed time: 28.408 msecs"
nil

user> (time (let [arr  (make-array Double/TYPE 1 1)] (dotimes [_
100000] (aset-double arr 0 0 0.0))))
"Elapsed time: 3634.136 msecs"
nil

I've tried adding type hints like #^"[[D" to no avail.  What am I
missing here?

BTW, I'm still on the pre-lazy SVN, waiting for the dust to settle.

Thanks,
Jason

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