Thanks for the info.  I'd need to research how clojure.lang.BigInt
differs from java.math.BigInteger, but I'm sure that adding the extra
case for BigInt in the multimethods wouldn't be too hard.

I'm still stumped as to why expt and sqrt would be 100x slower.  My
first thought is that the loop/recur machinery has changed in 1.3, to
support primitives in the recur, so perhaps there's some extra back
and forth boxing/unboxing going on, or perhaps loop/recur is just
fundamentally slower now?  Another possibility is that all the literal
numbers are now longs instead of Integers, so maybe that's slowing
down the computations?

I'd be curious to know whether explicitly boxing everything in the
second line of expt-int helps the performance at all (along with the '
math operators), i.e.,

(defn- expt-int [base pow]
  (loop [n pow, y (num 1), z base]

to

(defn- expt-int [base pow]
  (loop [n (num pow), y (num 1), z (num base)]

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

Reply via email to