There are already a number of optimizations to make context creation fast in V8. They are based on the snapshotting system where basically new contexts are cloned from a "boilerplate" context. Are you building V8 with snapshots turned on (snapshot=on when building with SCons)? For some reason the default is to build without snapshots.
Regards, Søren On Thu, Dec 2, 2010 at 03:45, hua ye <[email protected]> wrote: > Dears, > > v8 is an excellent script engine. Now we are using it to develop a > script emulator to run the script fragments in HTML pages. > Performance is the most important index for our project. The profiling > result shows that it costs the most time to create a new v8 context. > To avoid the pollution between different HTML pages, a fresh context > is needed for each page. > Is there any way to reset a context to the fresh state after running > script in it? Like: create a new context -> run script in this context > -> reset to the initial state -> run other script -> reset to the > initial state ->.... > Is it possible to create a fresh context as the root, later contexts > are cloned from it to reduce the cost? > > Thanks! > > Kenny > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
