Add this line at the top of your file where you try areduce and loop, and look for any reflection warnings that occur when loading the file:
(set! *warn-on-reflection* true) If there are none, probably best to post a link to your code, or paste it in a message here if it is short enough, so others can give more precise suggestions. Andy On Wed, Jun 10, 2015 at 1:03 PM, Ritchie Cai <ritchie...@gmail.com> wrote: > I'm working on a java array of double with 1280000 elements. I need the > max and min values of the array. So I initially tried areduce and loop, > both gives runs around 20 seconds. But when try (apply max (vec array)) I > get result under 90 ms. > Can anyone explain why there is such a big difference? > Also if want to iterate large java array like this to do some other > operations, e.g. convolution, what's the best way to go? Is there another > fast way to iterate through array or do I need to convert array into vector? > > Thanks > Ritchie > > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.