It would be a decent memory saver I think.  The runtime information
getting cached in the AST is the only issue I can think of.  This
would probably trim off a meg or two of heap for each addition
instance (the AST is a large memory consumer).

-Tom

On 8/14/07, Ola Bini <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Jon Tirsen proposed that a nice thing for Goldspike would be to share
> the AST's between runtimes, to avoid the huge memory impact and
> performance of loading Rails over and over again for a new runtime.
>
> I'm wondering whether this is something we should do. Basically, we
> could implement org.jruby.Ruby.clone, which would return copies of
> everything in the current runtime, except that all AST links points to
> the same AST as the first one.
>
> To make this feasible, we would need to remove runtime dependent
> information from the AST. As far as I can see, there are only three
> nodes which cache information of some sort connected to a runtime:
>
> FixnumNode
> RegexpNode
> ReturnNode (target)
>
> Now, both FixnumNode and RegexpNode would be quite easy to exteralize
> into some other cache outside the AST. The main problem would be the
> ReturnNode, where target is a RubyObject (I think).
>
> Anyone have any opinionss? Would it be worth doing?
>
> Cheers
>
> --
>  Ola Bini (http://ola-bini.blogspot.com)
>  JRuby Core Developer
>  Developer, ThoughtWorks Studios (http://studios.thoughtworks.com)
>
>  "Yields falsehood when quined" yields falsehood when quined.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>


-- 
Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: [EMAIL PROTECTED] , [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to