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

benchmark: split timers benchmark and refactor #9497

Closed
wants to merge 2 commits into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Nov 7, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

benchmark timers

Description of change

The depth benchmark for timers sets a timer that sets a timer that sets
a timer that... 500K of them.

Since each timer has to wait for the next tick of the event loop this
benchmark takes a very long time to run compared to the breadth
test that is already in the file. This may be more of an event loop
benchmark than a timer benchmark.

Reduce the number of iterations for the depth test as it's really just
running the iterations in sequence, not in parallel. And even on an
infinitely fast machine, it would take over 8 minutes to run because
each tick of the event loop would have to wait 1ms before firing the
timer.

Split the depth and breadth benchmarks so that their N values can be
set independently.

Do some minor refactoring to the benchmarks (but no ES6 additions so
that the benchmarks can still be run with old versions of Node.js).

Refs: #9493

@Trott Trott added timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. benchmark Issues and PRs related to the benchmark subsystem. labels Nov 7, 2016

var bench = common.createBenchmark(main, {
thousands: [500],
type: ['breadth']
Copy link
Member

Choose a reason for hiding this comment

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

the filename is included in the output, so this is not needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed it! Thanks!

The depth benchmark for timers sets a timer that sets a timer that sets
a timer that... 500K of them.

Since each timer has to wait for the next tick of the event loop this
benchmark takes a very long time to run compared to the breadth
test that is already in the file. This may be more of an event loop
benchmark than a timer benchmark.

Reduce the number of iterations for the depth test as it's really just
running the iterations in sequence, not in parallel. And even on an
infinitely fast machine, it would take over 8 minutes to run because
each tick of the event loop would have to wait 1ms before firing the
timer.

Split the depth and breadth benchmarks so that their `N` values can be
set independently.

Do some minor refactoring to the benchmarks (but no ES6 additions so
that the benchmarks can still be run with old versions of Node.js).

Refs: nodejs#9493
Copy link
Member

@AndreasMadsen AndreasMadsen left a comment

Choose a reason for hiding this comment

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

LGTM

var common = require('../common.js');

var bench = common.createBenchmark(main, {
thousands: [500],
Copy link
Member

Choose a reason for hiding this comment

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

Nit: trailing comma.

var common = require('../common.js');

var bench = common.createBenchmark(main, {
thousands: [1],
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

Copy link
Contributor

@Fishrock123 Fishrock123 left a comment

Choose a reason for hiding this comment

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

eh, seems fine. Still need better/different benchmarks.

I'll try to dedicate a bit of time this week to it.

@Trott
Copy link
Member Author

Trott commented Nov 10, 2016

@Trott
Copy link
Member Author

Trott commented Nov 10, 2016

Landed in ef6a5cf

@Trott Trott closed this Nov 10, 2016
Trott added a commit to Trott/io.js that referenced this pull request Nov 10, 2016
The depth benchmark for timers sets a timer that sets a timer that sets
a timer that... 500K of them.

Since each timer has to wait for the next tick of the event loop this
benchmark takes a very long time to run compared to the breadth
test that is already in the file. This may be more of an event loop
benchmark than a timer benchmark.

Reduce the number of iterations for the depth test as it's really just
running the iterations in sequence, not in parallel. And even on an
infinitely fast machine, it would take over 8 minutes to run because
each tick of the event loop would have to wait 1ms before firing the
timer.

Split the depth and breadth benchmarks so that their `N` values can be
set independently.

Do some minor refactoring to the benchmarks (but no ES6 additions so
that the benchmarks can still be run with old versions of Node.js).

Refs: nodejs#9493
PR-URL: nodejs#9497
Reviewed-By: Andreas Madsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
addaleax pushed a commit that referenced this pull request Nov 22, 2016
The depth benchmark for timers sets a timer that sets a timer that sets
a timer that... 500K of them.

Since each timer has to wait for the next tick of the event loop this
benchmark takes a very long time to run compared to the breadth
test that is already in the file. This may be more of an event loop
benchmark than a timer benchmark.

Reduce the number of iterations for the depth test as it's really just
running the iterations in sequence, not in parallel. And even on an
infinitely fast machine, it would take over 8 minutes to run because
each tick of the event loop would have to wait 1ms before firing the
timer.

Split the depth and breadth benchmarks so that their `N` values can be
set independently.

Do some minor refactoring to the benchmarks (but no ES6 additions so
that the benchmarks can still be run with old versions of Node.js).

Refs: #9493
PR-URL: #9497
Reviewed-By: Andreas Madsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
@MylesBorins
Copy link
Contributor

@Trott do you think this should be backported?

@Trott
Copy link
Member Author

Trott commented Dec 13, 2016

@thealphanerd Yes. (Is landing cleanly for me on both v4.x-staging and v6.x-staging.)

MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
The depth benchmark for timers sets a timer that sets a timer that sets
a timer that... 500K of them.

Since each timer has to wait for the next tick of the event loop this
benchmark takes a very long time to run compared to the breadth
test that is already in the file. This may be more of an event loop
benchmark than a timer benchmark.

Reduce the number of iterations for the depth test as it's really just
running the iterations in sequence, not in parallel. And even on an
infinitely fast machine, it would take over 8 minutes to run because
each tick of the event loop would have to wait 1ms before firing the
timer.

Split the depth and breadth benchmarks so that their `N` values can be
set independently.

Do some minor refactoring to the benchmarks (but no ES6 additions so
that the benchmarks can still be run with old versions of Node.js).

Refs: #9493
PR-URL: #9497
Reviewed-By: Andreas Madsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
The depth benchmark for timers sets a timer that sets a timer that sets
a timer that... 500K of them.

Since each timer has to wait for the next tick of the event loop this
benchmark takes a very long time to run compared to the breadth
test that is already in the file. This may be more of an event loop
benchmark than a timer benchmark.

Reduce the number of iterations for the depth test as it's really just
running the iterations in sequence, not in parallel. And even on an
infinitely fast machine, it would take over 8 minutes to run because
each tick of the event loop would have to wait 1ms before firing the
timer.

Split the depth and breadth benchmarks so that their `N` values can be
set independently.

Do some minor refactoring to the benchmarks (but no ES6 additions so
that the benchmarks can still be run with old versions of Node.js).

Refs: #9493
PR-URL: #9497
Reviewed-By: Andreas Madsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
The depth benchmark for timers sets a timer that sets a timer that sets
a timer that... 500K of them.

Since each timer has to wait for the next tick of the event loop this
benchmark takes a very long time to run compared to the breadth
test that is already in the file. This may be more of an event loop
benchmark than a timer benchmark.

Reduce the number of iterations for the depth test as it's really just
running the iterations in sequence, not in parallel. And even on an
infinitely fast machine, it would take over 8 minutes to run because
each tick of the event loop would have to wait 1ms before firing the
timer.

Split the depth and breadth benchmarks so that their `N` values can be
set independently.

Do some minor refactoring to the benchmarks (but no ES6 additions so
that the benchmarks can still be run with old versions of Node.js).

Refs: #9493
PR-URL: #9497
Reviewed-By: Andreas Madsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
The depth benchmark for timers sets a timer that sets a timer that sets
a timer that... 500K of them.

Since each timer has to wait for the next tick of the event loop this
benchmark takes a very long time to run compared to the breadth
test that is already in the file. This may be more of an event loop
benchmark than a timer benchmark.

Reduce the number of iterations for the depth test as it's really just
running the iterations in sequence, not in parallel. And even on an
infinitely fast machine, it would take over 8 minutes to run because
each tick of the event loop would have to wait 1ms before firing the
timer.

Split the depth and breadth benchmarks so that their `N` values can be
set independently.

Do some minor refactoring to the benchmarks (but no ES6 additions so
that the benchmarks can still be run with old versions of Node.js).

Refs: #9493
PR-URL: #9497
Reviewed-By: Andreas Madsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
The depth benchmark for timers sets a timer that sets a timer that sets
a timer that... 500K of them.

Since each timer has to wait for the next tick of the event loop this
benchmark takes a very long time to run compared to the breadth
test that is already in the file. This may be more of an event loop
benchmark than a timer benchmark.

Reduce the number of iterations for the depth test as it's really just
running the iterations in sequence, not in parallel. And even on an
infinitely fast machine, it would take over 8 minutes to run because
each tick of the event loop would have to wait 1ms before firing the
timer.

Split the depth and breadth benchmarks so that their `N` values can be
set independently.

Do some minor refactoring to the benchmarks (but no ES6 additions so
that the benchmarks can still be run with old versions of Node.js).

Refs: #9493
PR-URL: #9497
Reviewed-By: Andreas Madsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
This was referenced Dec 21, 2016
@Trott Trott deleted the timers-benchmark branch January 13, 2022 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Issues and PRs related to the benchmark subsystem. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants