I can't see the advantages of option 2 ... we have to assume every bit of
JS is different so its not about sharing a .class. If we can have a lazy
loading + unloading scheme in place then option 1 is fine IMO.

We should be able to piggyback off the webapp lazyloading stuff?

Sanjiva.

On Thu, Jun 21, 2012 at 6:28 PM, Ruchira Wageesha <[email protected]> wrote:

> Hi all,
>
> We are using Rhino's script compilation support in Jaggery product to
> improve the performance of JS execution.
>
> When we compiled a JS file using Rhino, we can get either
>
>    1. An object(Script) of the *.class file
>       - This will be kept in memory and executed when ever needed
>       - When n webapps of m size in a jaggery server are equally
>       accessed, n x m memory will be needed in order keep all webapp objects 
> in
>       memory
>       - If the server doesn't have enough memory, then we will have to
>       recompile the same webapp time to time
>    2. A *.class file for that script
>       - In this way, we can save the *.class file to the disk and load it
>       using a custom classloader.
>       - In a muti-tenant environment, we can release the memory of unused
>       classloaders and load the classes on demand using saved *.class files
>       - As per my understanding, it would be able to server n webapps of
>       m size using less amount of memory than above 1 by unloading unused
>       classloaders and loading *.class on demand
>
> Currently it has been implemented to work in both modes, but I am not sure
> which one would be ideal for the case.
>
> Welcome your thoughts ....
>
> regards,
> Ruchira
>
> --
> *Ruchira Wageesha
> Senior Software Engineer & Member, Management Committee, Development
> Technologies*
> *WSO2 Inc. - lean . enterprise . middleware |  wso2.com*
> *
> email: [email protected],   blog: ruchirawageesha.blogspot.com,   mobile: +94
> 77 5493444*
>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://mail.jaggeryjs.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sanjiva Weerawarana, Ph.D.
Founder, Chairman & CEO; WSO2, Inc.;  http://wso2.com/
email: [email protected]; phone: +94 11 763 9614; cell: +94 77 787 6880 | +1
650 265 8311
blog: http://sanjiva.weerawarana.org/

Lean . Enterprise . Middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to