summaryrefslogtreecommitdiff
path: root/benchmark/util
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-02-10 20:03:44 +0100
committerAnna Henningsen <anna@addaleax.net>2020-02-10 22:35:08 +0100
commit7cfbc9f90f3109feaeb9db5df9d4d692a62178ef (patch)
treec72cdafcd8c00b2d660633fd7c59f6cf999feaef /benchmark/util
parent2abf0afb2b9e2f9e9824e2cbb08bdec27794d039 (diff)
downloadnode-new-7cfbc9f90f3109feaeb9db5df9d4d692a62178ef.tar.gz
Revert "benchmark: remove special test entries"
This reverts commit 357230f4b7174380467edfb0a65a00b65b0af66c. Refs: https://github.com/nodejs/node/pull/31396 PR-URL: https://github.com/nodejs/node/pull/31722 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'benchmark/util')
-rw-r--r--benchmark/util/format.js3
-rw-r--r--benchmark/util/inspect-array.js2
-rw-r--r--benchmark/util/type-check.js3
3 files changed, 7 insertions, 1 deletions
diff --git a/benchmark/util/format.js b/benchmark/util/format.js
index f7a6caa81c..976e0f4e65 100644
--- a/benchmark/util/format.js
+++ b/benchmark/util/format.js
@@ -23,7 +23,8 @@ const bench = common.createBenchmark(main, {
});
function main({ n, type }) {
- const [first, second] = inputs[type];
+ // For testing, if supplied with an empty type, default to string.
+ const [first, second] = inputs[type || 'string'];
bench.start();
for (let i = 0; i < n; i++) {
diff --git a/benchmark/util/inspect-array.js b/benchmark/util/inspect-array.js
index 987b404791..4fd73785f7 100644
--- a/benchmark/util/inspect-array.js
+++ b/benchmark/util/inspect-array.js
@@ -23,6 +23,8 @@ function main({ n, len, type }) {
opts = { showHidden: true };
arr = arr.fill('denseArray');
break;
+ // For testing, if supplied with an empty type, default to denseArray.
+ case '':
case 'denseArray':
arr = arr.fill('denseArray');
break;
diff --git a/benchmark/util/type-check.js b/benchmark/util/type-check.js
index 792f61cf6f..8d57bc000a 100644
--- a/benchmark/util/type-check.js
+++ b/benchmark/util/type-check.js
@@ -35,6 +35,9 @@ const bench = common.createBenchmark(main, {
});
function main({ type, argument, version, n }) {
+ // For testing, if supplied with an empty type, default to ArrayBufferView.
+ type = type || 'ArrayBufferView';
+
const util = common.binding('util');
const types = require('internal/util/types');