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 <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
  • Loading branch information
mscdex authored and jasnell committed Jun 24, 2020
1 parent 4629e96 commit 336546b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions benchmark/events/eventtarget.js
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 336546b

Please sign in to comment.