Re: Amap vs Map performance

2010-07-08 Thread Harvey Hirst
With 1.2: (set! *warn-on-reflection* true) (time (amap an-array idx ret (+ (int 1) (aget an-array idx Reflection warning, NO_SOURCE_PATH:52 - call to aclone can't be resolved. Reflection warning, NO_SOURCE_PATH:52 - call to alength can't be resolved. Reflection warning, NO_SOURCE_PATH:52 -

Re: Extremely silly benchmarks, on types, records and maps.

2010-05-12 Thread Harvey Hirst
It's slow because it has to use reflection to determine the type. Use (set! *warn-on-reflection* true) and you'll see the warning. Try something like this and you'll see significantly faster results: (let [#^testType t (new testType 1 2 3)] (time (dotimes [_ 1000] (.a t))) Harvey --

Re: Missing fns: rotate rotate-while

2010-04-22 Thread Harvey Hirst
(defn rotate [n s]  (let [[front back] (split-at (mod n (count s)) s)]    (concat back front))) Don't forget (mod n 0) is an ArithmeticException. Harvey -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to