Skip to content

Commit 0eed22d

Browse files
mscdexcodebytere
authored andcommitted
benchmark: fix EventTarget benchmark
Fixes: #33782 PR-URL: #34015 Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent c34f474 commit 0eed22d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

benchmark/events/eventtarget.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const common = require('../common.js');
33

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

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

16-
const event = new Event('foo');
17-
1816
bench.start();
1917
for (let i = 0; i < n; i++) {
20-
target.dispatchEvent(event);
18+
target.dispatchEvent(new Event('foo'));
2119
}
2220
bench.end(n);
2321

0 commit comments

Comments
 (0)