summaryrefslogtreecommitdiff
path: root/benchmark/buffers/buffer-indexof.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-03-04 01:34:00 +0100
committerRich Trott <rtrott@gmail.com>2019-06-20 12:55:50 -0600
commit7b802685c4980addb51de8f6854de71dce8493f3 (patch)
tree85be26bfea0c69360f2e793b8037dad4a1fe87d8 /benchmark/buffers/buffer-indexof.js
parent5ccce52113a0f01da474eb066ac40d2dcbea1a55 (diff)
downloadandroid-node-v8-7b802685c4980addb51de8f6854de71dce8493f3.tar.gz
android-node-v8-7b802685c4980addb51de8f6854de71dce8493f3.tar.bz2
android-node-v8-7b802685c4980addb51de8f6854de71dce8493f3.zip
benchmark: refactor buffer benchmarks
Currently the buffer benchmarks take significantly too long to complete. This drastically reduces the overall runtime by removing obsolete checked variations and reducing the iteration count. It also improves the benchmarks by removing the deprecated `new Buffer(size)` usage and some other small improvements. PR-URL: https://github.com/nodejs/node/pull/26418 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Peter Marshall <petermarshall@chromium.org> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'benchmark/buffers/buffer-indexof.js')
-rw-r--r--benchmark/buffers/buffer-indexof.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/benchmark/buffers/buffer-indexof.js b/benchmark/buffers/buffer-indexof.js
index f3b9dcf1fa..cd083e8579 100644
--- a/benchmark/buffers/buffer-indexof.js
+++ b/benchmark/buffers/buffer-indexof.js
@@ -6,16 +6,12 @@ const path = require('path');
const searchStrings = [
'@',
'SQ',
- '10x',
'--l',
'Alice',
'Gryphon',
- 'Panther',
'Ou est ma chatte?',
'found it very',
- 'among mad people',
'neighbouring pool',
- 'Soo--oop',
'aaaaaaaaaaaaaaaaa',
'venture to go near the house till she had brought herself down to',
'</i> to the Caterpillar',
@@ -23,9 +19,9 @@ const searchStrings = [
const bench = common.createBenchmark(main, {
search: searchStrings,
- encoding: ['undefined', 'utf8', 'ucs2', 'binary'],
+ encoding: ['utf8', 'ucs2'],
type: ['buffer', 'string'],
- n: [100000]
+ n: [5e4]
});
function main({ n, search, encoding, type }) {