As the name implies, isolates are designed to be isolated from each other,
and that includes separation of generated code. This is a security feature.
Also, since generated code contains isolate-specific stuff (memory
addresses and so forth) embedded into it, it's not easily possible to share
it across isolates.

V8 does have a per-isolate compilation cache. It should prevent
recompilation of the same script. If you want to make sure that it works
for your use-case, run V8 with --print-code and check how often the code
for the function in question is printed.


On Sat, May 5, 2012 at 7:16 PM, MikeM <[email protected]> wrote:

> I have the same question and the exact same requirements.
> I cache of compiled scripts I can share across isolates and multiple
> threads.
>
> On May 5, 1:38 am, Yair <[email protected]> wrote:
> > I'm running v8 across multiple threads, each thread has its own
> > Isolate.
> > The threads run the same pool of scripts, and each context is bound to
> > one thread.
> >
> > I want to cache the script compile results to improve performance.
> >
> > 1) Does v8 have its own caching for script-compilations or does it re-
> > run the compilation each time a compilation is requested ?
> > 2) If I do need to use my own cache, could the compilations be used
> > across Isolates ?
> >
> > Yair.
>

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to