> I may be wrong, but doesn't a typical function invocation involve
> dereferencing the Var holding the object that implements "IFn" and
> calling invoke?  It seems pretty intuitive to me that this would be
> difficult to inline by the JIT, there is a little bit of
> synchronization going on every time a Var is dereferenced.
In principle, the JIT can inline the Var lookup, and do the  
appropriate analysis to eliminate much of the work -- Vars have thread- 
local bindings, so the JVM should be pretty well aware of access and  
scope. Of course, this will only happen if everything is small enough,  
frequently used, etc. etc.

I saw a presentation at JavaOne which illustrated to just what extent  
the dynamic compiler can eliminate locks, allocations, aliases,  
synchronization boundaries, do closed-world analysis of class  
hierarchies, and so on. It's pretty impressive. ("Inside Out: A Modern  
Virtual Machine Revealed", if you're interested.)

-R

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