>
> On Mon, Jan 4, 2010 at 8:54 AM, Attila Szegedi <[email protected]> wrote:
>
>
>> Your choices are basically:
>> a) use one non-shared top-level scope per script execution, suffer from
>> repeated reflection lookups between script executions
>>
>> b) use one shared scope per script execution as a prototype of non-shared
>> per-execution scopes. Drawbacks: need to use dynamic scoping (nonstandard
>> JS), and scripts have shared state *that is mutable*.
>>
>> c) have one ClassCache and assign it to every scope you create - see
>> ClassCache#associate() and ClassCache#get- you'll have to do it on the scope
>> *before* calling initStandardObjects() as it'll install an empty new
>> ClassCache into it. Drawback: Java methods and constructors mirrored into
>> your scope will use Function prototype from another scope (the one
>> ClassCache was first associated with) - I'm not sure if this can cause any
>> problems (aside from never releasing that first scope from memory, which is
>> a minor, fixed size memory usage increase), it might actually work in your
>> scenario.
>>
>
Thanks, Attila, this is good information I'll file away until I get the time
to address performance.

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:[email protected]
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to