Well, I was thinking smaller to start with.  Hotspot identifies places where
classes don't escape a method for instance and can use that to elide locks
and inline field references without calling a constructor for instance.  So
it would be great to do this at the fn level in clojure as well, you know
for instance that "let" local variables can only escape from the function in
a few ways so they could often be mutable/optimized.
-- Aaron


On Mon, Jul 27, 2009 at 4:43 PM, Stuart Sierra
<the.stuart.sie...@gmail.com>wrote:

>
> That sounds really, really hard.  Because even if the structure is
> used in only one thread, you have to check that there's never a
> reference to an older version.
>
> You could theoretically re-implement the Persistent List/Map/Set
> interfaces with mutable implementations, but I don't know where to go
> from there.
>
> -SS
>
>
> On Jul 27, 1:37 pm, Aaron Cohen <remled...@gmail.com> wrote:
> > What kind of infrastructure would it take to do something like Escape
> > Analysis in the clojure compiler?
> > It seems to me that it should be possible for "something" (the clojure
> > compiler?, a new JIT of some sort?) to notice that a data structure is
> being
> > used in a thread-local manner, and use that knowledge to replace a
> > Persistent data structure with a mutable one as an optimization.  Any
> idea
> > where the best place to start looking into this would be?
> >
> > -- Aaron
> >
>

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