Skip to content

timers: improve Timer.now() performance - #2256

Merged
bnoordhuis merged 4 commits into
nodejs:masterfrom
bnoordhuis:optimize-timer-now
Jul 27, 2015
Merged

timers: improve Timer.now() performance#2256
bnoordhuis merged 4 commits into
nodejs:masterfrom
bnoordhuis:optimize-timer-now

Conversation

@bnoordhuis

Copy link
Copy Markdown
Member

Record the start time so we can make the return value of Timer.now()
relative to it, increasing the chances that it fits in a tagged integer
instead of a heap-allocated double, at least for the first one or two
billion milliseconds.

R=@trevnorris?

CI: https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/203/

@bnoordhuisbnoordhuis added the timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. label Jul 27, 2015
@trevnorris

Copy link
Copy Markdown
Contributor

Slick job. LGTM.

Comment threadtest/parallel/test-timers-now.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const? :)

PR-URL: nodejs#2256
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: nodejs#2256
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: nodejs#2256
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Record the start time so we can make the return value of Timer.now()
relative to it, increasing the chances that it fits in a tagged integer
instead of a heap-allocated double, at least for the first one or two
billion milliseconds.
PR-URL: nodejs#2256
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
@bnoordhuis
bnoordhuis deleted the optimize-timer-now branch July 27, 2015 22:14
@bnoordhuis
bnoordhuis merged commit 543dabb into nodejs:masterJul 27, 2015
@bnoordhuis

Copy link
Copy Markdown
MemberAuthor

Thanks, landed in 503b089...543dabb with const-ification of the test.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@bnoordhuis@trevnorris@Fishrock123