This project is read-only.

Persistance and Reloading of Compiled Script

Nov 13, 2013 at 10:35 AM
Hello James,

I was wondering is there a way i could persist or serialize the Compile Script to the disk or file and later reload each compiled Script libs based on my application scenario need.

For (e.g)

function test() {
js scripts

function test2() {
js scripts

I would like to compile the above scripts and persist them in disk and later just load them to re-executed based on the app context. I was going the API's not sure if this is supported and could be supported. I also ran through the V8's Script object and couldn't find anything that could support this, just wondering if this could be possible in case

with best regards
Nov 13, 2013 at 8:23 PM

Google's V8 engine JIT-compiles to machine code. There's no access to this information, so it's not natively possible using any V8 API that I'm aware of. In fact, I doubt any engine will allow you to do this.

You're going to have to save the script code itself, and load them when needed using "{v8engine}.LoadScript(...)".
Nov 14, 2013 at 12:52 PM

Yes i knew it's not possible but was checking out of curiosity... :-)