Subj : Re: Persistent storage of compiled scripts To : Thorsten R From : Brendan Eich Date : Tue Jul 20 2004 08:51 am Thorsten R wrote: > Hello, > > is it possible to compile scripts and store the resulting code persistantly > in a file for later use? > > In other words: we don't want to compile the whole JS code each time it is > loaded into our application. Instead we would like to compile it once and > use the p-code then immediately at runtime. > > If this is possible: how do we get access to the p-code (for storage to > file) and how do we feed the p-code later back to the interpreter engine? See jsxdrapi.h's JS_XDRScript, which you can use in conjunction with JS_Compile*Script* (to generate a top-level script to be serialized) and JS_ExecuteScript (after deserializing). /be .