Re: autoboxing in 1.3 RC-0

2011-09-15 Thread pmbauer
see https://github.com/clojure/test.benchmark/blob/master/src/main/clojure/alioth/mandelbrot.clj#L49 There's two ways to get rid of the reflection warning: 1) another function, appropriately type hinted 2) explicit conversion to long According to my measurements for this particular case, option

Re: autoboxing in 1.3 RC-0

2011-09-15 Thread pmbauer
I ran into this exact issue on an alioth benchmark. Adding the explicit (long ...) conversion gets rid of the reflection warning, but didn't have a significant effect on performance. The inner loop is still boxing the return value. On Thursday, September 15, 2011 8:36:53 AM UTC-7, Sean Corfield w

Re: autoboxing in 1.3 RC-0

2011-09-15 Thread Ken Wesson
On Thu, Sep 15, 2011 at 10:50 AM, David Nolen wrote: > On Thu, Sep 15, 2011 at 3:18 AM, Sergey Didenko > wrote: >> Auto-boxing loop arg: change" >> >> (loop [x 1 changed 0] >>  (if (= x 10) >>    changed >>    (recur (inc x) >>           (loop [y 1 changed-y changed] >>             changed-y

Re: autoboxing in 1.3 RC-0

2011-09-15 Thread Sergey Didenko
Thanks! Though it is not obvious IMHO. > (loop [x 1 changed 0] >  (if (= x 10) >   changed >   (recur (inc x) >          (long (loop [y 1 changed-y changed] >                  changed-y) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: autoboxing in 1.3 RC-0

2011-09-15 Thread Sean Corfield
On Thu, Sep 15, 2011 at 7:50 AM, David Nolen wrote: > Loop itself will return boxed values I think. Looks that way. The following code has no reflection warning: (loop [x 1 changed 0] (if (= x 10) changed (recur (inc x) (long (loop [y 1 changed-y changed] chang

Re: autoboxing in 1.3 RC-0

2011-09-15 Thread David Nolen
On Thu, Sep 15, 2011 at 3:18 AM, Sergey Didenko wrote: > Hi, > > Is it a bug or I'm doing something wrong? I can't get rid of > auto-boxing in the second example, neither by type hinting nor by type > coercing of "changed*" locals. > > (set! *warn-on-reflection* true) > > This compiles fine: > > (

autoboxing in 1.3 RC-0

2011-09-15 Thread Sergey Didenko
Hi, Is it a bug or I'm doing something wrong? I can't get rid of auto-boxing in the second example, neither by type hinting nor by type coercing of "changed*" locals. (set! *warn-on-reflection* true) This compiles fine: (loop [x 1 changed 0] (if (= x 10) changed (recur (inc x)