Skip to content

Commit c4aaa5d

Browse files
committed
simplify isNativeError test arguments and remove performance logging
1 parent 9de3f6f commit c4aaa5d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

benchmark/util/is-native-error.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const args = {
1111
const bench = common.createBenchmark(
1212
main,
1313
{
14-
argument: ['true', 'falsePrimitive', 'falseObject'],
15-
version: ['native', 'js'],
14+
argument: ['true'],
15+
version: ['native'],
1616
n: [1e6],
1717
},
1818
{
@@ -25,16 +25,11 @@ function main({ argument, version, n }) {
2525
const types = require('internal/util/types');
2626

2727
const func = { native: util, js: types }[version].isNativeError;
28-
29-
const testArgs = [args.true, args.falsePrimitive, args.falseObject];
28+
const arg = args[argument];
3029

3130
bench.start();
32-
const start = performance.now();
3331
for (let iteration = 0; iteration < n; iteration++) {
34-
const testArg = testArgs[iteration % testArgs.length];
35-
func(testArg);
32+
func(arg);
3633
}
37-
const end = performance.now();
3834
bench.end(n);
39-
console.log('Elapsed(ms):', (end - start).toFixed(3));
4035
}

0 commit comments

Comments
 (0)