Skip to content

Commit

Permalink
benchmark: fix EventTarget benchmark
Browse files Browse the repository at this point in the history
Fixes: #33782

PR-URL: #34015
Reviewed-By: Denys Otrishko <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
  • Loading branch information
mscdex authored and codebytere committed Jun 27, 2020
1 parent c34f474 commit 0eed22d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions benchmark/events/eventtarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const common = require('../common.js');

const bench = common.createBenchmark(main, {
n: [2e7],
n: [1e6],
listeners: [1, 5, 10]
}, { flags: ['--expose-internals'] });

Expand All @@ -13,11 +13,9 @@ function main({ n, listeners }) {
for (let n = 0; n < listeners; n++)
target.addEventListener('foo', () => {});

const event = new Event('foo');

bench.start();
for (let i = 0; i < n; i++) {
target.dispatchEvent(event);
target.dispatchEvent(new Event('foo'));
}
bench.end(n);

Expand Down

0 comments on commit 0eed22d

Please sign in to comment.