You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VM: VM is much slower when timeout was specified #10453
I think maybe that's not a bug (timer for timeout is expansive?), but that's unexpected behavior. It would be nice if that limitation should be documented on VM API documentation.
When timeout option was specified, Script execution on VM is much slower then timeout options wasn't specified.
The script execution isn’t slower, but of course there’s overhead associated with setting up the timer and stopping it again (especially because Node can’t use its usual facilities for that), which happens once for each runInContext call.
You can move the for loop into the script itself and the difference should vanish. You can feel free to open a PR against the documentation, of course.
Activity
addaleax commentedon Dec 25, 2016
The script execution isn’t slower, but of course there’s overhead associated with setting up the timer and stopping it again (especially because Node can’t use its usual facilities for that), which happens once for each
runInContextcall.You can move the
forloop into the script itself and the difference should vanish. You can feel free to open a PR against the documentation, of course.mscdex commentedon Dec 25, 2016
Also on an unrelated note, using the
letin theforlike that is slower (not sure about node v7).doc: document vm timeout option perf impact
doc: document vm timeout option perf impact
doc: document vm timeout option perf impact
doc: document vm timeout option perf impact
doc: document vm timeout option perf impact
doc: document vm timeout option perf impact