Re: summing shorts vs summing ints

2011-06-04 Thread Stuart Sierra
I get reflection warnings on your `plusS` function. I think it's from adding the two `short`s. Remember that Clojure 1.3 only supports `long` and `double` primitives natively. The compiler may be a missing a case for conversion from `short` to `long`. If this is performance-critical code you

Re: summing shorts vs summing ints

2011-06-04 Thread David Nolen
On Sat, Jun 4, 2011 at 6:32 AM, bOR_ wrote: > (defn plusS ^shorts [^shorts array ^shorts arr2] > > > "adds two Short arrays" > > > (amap array idx ret (short (+ (aget array idx) (aget arr2 idx) > > > > > > (defn plusI ^ints [^ints array ^ints arr2] > > > "adds two Int arrays." > > > (

summing shorts vs summing ints

2011-06-04 Thread bOR_
Hi all, Noticed in Clojure 1.3-Alpha8 that there is a large difference in speed when adding two Short/TYPE arrays rather than two Integer/TYPE java arrays. Is that something related to clojure, my code, or just a CPU-related thing when it comes to summing. I'd like to save some memory by using