fastboot icon indicating copy to clipboard operation
fastboot copied to clipboard

use v8 cache data for vm script

Open krisselden opened this issue 7 years ago • 4 comments

krisselden avatar Sep 20 '17 23:09 krisselden

the var fileScript = new vm.Script(source, { filename: filePath }); does not need be redone every time, it doesn't hold context state. The thing we are caching this.sandbox actually does hold state.

krisselden avatar Sep 21 '17 00:09 krisselden

@krisselden are you suggesting do it once when the Node server comes up only? We currently do it once on startup and everytime some calls reload.

kratiahuja avatar Sep 21 '17 15:09 kratiahuja

It would make reload() cheaper, but for some reason I had it in my head we were doing a new one for different sessions.

krisselden avatar Sep 21 '17 17:09 krisselden

Aah no we don't do it for different sessions but when the Node process starts up and reload. I'll put a PR that splits this so reload is cheaper.

kratiahuja avatar Sep 22 '17 16:09 kratiahuja