Skip to content

Commit 5fffa8f

Browse files
committed
benchmark: calibrate util.deprecate
According to nodejs/performance#186 this benchmark takes 1 minute to run a single run. So using calibrate-n script it suggests reduce it from 1e5 to 1e3
1 parent 5cd6f8a commit 5fffa8f

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

benchmark/util/deprecate.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,26 @@
33
const common = require('../common');
44
const assert = require('assert');
55

6-
const bench = common.createBenchmark(main, {
7-
n: [1e5],
8-
modifyPrototype: [1, 0],
9-
emitWarningSync: [1, 0],
10-
}, {
11-
flags: ['--expose-internals'],
12-
});
6+
const bench = common.createBenchmark(
7+
main,
8+
{
9+
n: [1000],
10+
modifyPrototype: [1, 0],
11+
emitWarningSync: [1, 0],
12+
},
13+
{
14+
flags: ['--expose-internals'],
15+
},
16+
);
1317

1418
function simpleFunction(x) {
15-
return x * 2 + (new Array(1000)).fill(0).map((_, i) => i).reduce((a, b) => a + b, 0);
19+
return (
20+
x * 2 +
21+
new Array(1000)
22+
.fill(0)
23+
.map((_, i) => i)
24+
.reduce((a, b) => a + b, 0)
25+
);
1626
}
1727

1828
function main({ n, modifyPrototype, emitWarningSync }) {

0 commit comments

Comments
 (0)