Skip to content
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

lib: don't penalize setInterval/setTimeout common case #1221

Merged
merged 3 commits into from
Mar 21, 2015

Conversation

bnoordhuis
Copy link
Member

The common case is where setTimeout() is called with two arguments,
the callback and the timeout. Specifying optional arguments in the
parameter list forces common case calls to go through an arguments
adaptor stack frame.

R=@trevnorris?

@Fishrock123
Copy link
Contributor

Origin commit: bd1bd7e

@bnoordhuis
Copy link
Member Author

The common case is where setTimeout() is called with two arguments,
the callback and the timeout.  Specifying optional arguments in the
parameter list forces common case calls to go through an arguments
adaptor stack frame.

PR-URL: nodejs#1221
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
The common case is where setInterval() is called with two arguments,
the callback and the timeout.  Specifying optional arguments in
the parameter list forces common case calls to go through an arguments
adaptor stack frame.

PR-URL: nodejs#1221
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
It turns out we have little to no test coverage for setTimeout() and
setInterval() calls with optional arguments.  Now we do.

PR-URL: nodejs#1221
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
@trevnorris
Copy link
Contributor

LGTM

Aside: Thought the penalization was mostly fixed (so that the performance difference was essentially white noise) in V8 for calling a function with too many parameters. My bad for not catching that before it was pushed.

@bnoordhuis bnoordhuis closed this Mar 21, 2015
@bnoordhuis bnoordhuis deleted the optimize-timers branch March 21, 2015 10:09
@bnoordhuis bnoordhuis merged commit 2b3b2d3 into nodejs:v1.x Mar 21, 2015
@rvagg rvagg mentioned this pull request Mar 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants