On Mar 9, 2010, at 1:19 PM, Richard Newman wrote:

>> I suspect that on recursion
> 
> If you use plain function-calling recursion, yes. If you use (loop ... 
> recur...) then (IIRC) locals are not boxed (as well as saving stack).
> 
> Also bear in mind that JIT will come into play here; after a few tens of 
> thousands of arithmetic ops, the common path will be nearly free. Don't call 
> something slow without measuring it.
> 

I agree that the JVM can do boxing / unboxing relatively efficiently, and yes, 
surely I would not be looking to write a high-perf algorithm with something 
that is not effectively tail recursion.   My main points in the note were that 
by default there is an expensive dispatch occurring over and over again with 
each fundamental operation.    The type hints work around this, but become 
burdensome for, say, math code with a lot of literals and/or variables.



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