-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VM: VM is much slower when timeout
was specified
#10453
Comments
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 You can move the |
Also on an unrelated note, using the |
Mention that the `timeout` option has a noticeable performance impact. Fixes: nodejs#10453
Mention that the `timeout` option has a noticeable performance impact. Fixes: nodejs#10453 PR-URL: nodejs#12751 Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Mention that the `timeout` option has a noticeable performance impact. Fixes: #10453 PR-URL: #12751 Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Mention that the `timeout` option has a noticeable performance impact. Fixes: #10453 PR-URL: #12751 Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Mention that the `timeout` option has a noticeable performance impact. Fixes: #10453 PR-URL: #12751 Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Node.js v6.7.0 / Node.js 4.4.2
Ubuntu 14.04 LTS x64 (v6.7.0) / macOS Sierra (v4.4.2)
VM
I just found there's unexpected behavior on
timeout
option ofvm.runInContext
.When
timeout
option was specified, Script execution on VM is much slower thentimeout
options wasn't specified.This is two of example snippets to reproduce that problem:
vm-normal.js
vm-with-timeout.js
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.
The text was updated successfully, but these errors were encountered: