diff options
Diffstat (limited to 'benchmark/buffers')
-rw-r--r-- | benchmark/buffers/buffer-base64-decode.js | 2 | ||||
-rw-r--r-- | benchmark/buffers/buffer-indexof.js | 24 | ||||
-rw-r--r-- | benchmark/buffers/buffer-read.js | 24 | ||||
-rw-r--r-- | benchmark/buffers/buffer-write.js | 25 | ||||
-rw-r--r-- | benchmark/buffers/dataview-set.js | 25 |
5 files changed, 76 insertions, 24 deletions
diff --git a/benchmark/buffers/buffer-base64-decode.js b/benchmark/buffers/buffer-base64-decode.js index 3497bfd05f..01f7f1bc91 100644 --- a/benchmark/buffers/buffer-base64-decode.js +++ b/benchmark/buffers/buffer-base64-decode.js @@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, {}); function main(conf) { const s = 'abcd'.repeat(8 << 20); s.match(/./); // Flatten string. - assert.equal(s.length % 4, 0); + assert.strictEqual(s.length % 4, 0); const b = Buffer.allocUnsafe(s.length / 4 * 3); b.write(s, 0, s.length, 'base64'); bench.start(); diff --git a/benchmark/buffers/buffer-indexof.js b/benchmark/buffers/buffer-indexof.js index 380f40b23d..cae8b964ae 100644 --- a/benchmark/buffers/buffer-indexof.js +++ b/benchmark/buffers/buffer-indexof.js @@ -3,12 +3,26 @@ var common = require('../common.js'); var fs = require('fs'); 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' +]; + var bench = common.createBenchmark(main, { - search: ['@', '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'], + search: searchStrings, encoding: ['undefined', 'utf8', 'ucs2', 'binary'], type: ['buffer', 'string'], iter: [1] diff --git a/benchmark/buffers/buffer-read.js b/benchmark/buffers/buffer-read.js index 1cdc4bc469..d23bd029f8 100644 --- a/benchmark/buffers/buffer-read.js +++ b/benchmark/buffers/buffer-read.js @@ -1,15 +1,27 @@ 'use strict'; var common = require('../common.js'); +var types = [ + 'UInt8', + 'UInt16LE', + 'UInt16BE', + 'UInt32LE', + 'UInt32BE', + 'Int8', + 'Int16LE', + 'Int16BE', + 'Int32LE', + 'Int32BE', + 'FloatLE', + 'FloatBE', + 'DoubleLE', + 'DoubleBE' +]; + var bench = common.createBenchmark(main, { noAssert: ['false', 'true'], buffer: ['fast', 'slow'], - type: ['UInt8', 'UInt16LE', 'UInt16BE', - 'UInt32LE', 'UInt32BE', - 'Int8', 'Int16LE', 'Int16BE', - 'Int32LE', 'Int32BE', - 'FloatLE', 'FloatBE', - 'DoubleLE', 'DoubleBE'], + type: types, millions: [1] }); diff --git a/benchmark/buffers/buffer-write.js b/benchmark/buffers/buffer-write.js index ae78eaf91d..32c7330453 100644 --- a/benchmark/buffers/buffer-write.js +++ b/benchmark/buffers/buffer-write.js @@ -1,14 +1,27 @@ 'use strict'; var common = require('../common.js'); + +var types = [ + 'UInt8', + 'UInt16LE', + 'UInt16BE', + 'UInt32LE', + 'UInt32BE', + 'Int8', + 'Int16LE', + 'Int16BE', + 'Int32LE', + 'Int32BE', + 'FloatLE', + 'FloatBE', + 'DoubleLE', + 'DoubleBE' +]; + var bench = common.createBenchmark(main, { noAssert: ['false', 'true'], buffer: ['fast', 'slow'], - type: ['UInt8', 'UInt16LE', 'UInt16BE', - 'UInt32LE', 'UInt32BE', - 'Int8', 'Int16LE', 'Int16BE', - 'Int32LE', 'Int32BE', - 'FloatLE', 'FloatBE', - 'DoubleLE', 'DoubleBE'], + type: types, millions: [1] }); diff --git a/benchmark/buffers/dataview-set.js b/benchmark/buffers/dataview-set.js index a208effd82..717a77de71 100644 --- a/benchmark/buffers/dataview-set.js +++ b/benchmark/buffers/dataview-set.js @@ -1,12 +1,25 @@ 'use strict'; var common = require('../common.js'); + +var types = [ + 'Uint8', + 'Uint16LE', + 'Uint16BE', + 'Uint32LE', + 'Uint32BE', + 'Int8', + 'Int16LE', + 'Int16BE', + 'Int32LE', + 'Int32BE', + 'Float32LE', + 'Float32BE', + 'Float64LE', + 'Float64BE' +]; + var bench = common.createBenchmark(main, { - type: ['Uint8', 'Uint16LE', 'Uint16BE', - 'Uint32LE', 'Uint32BE', - 'Int8', 'Int16LE', 'Int16BE', - 'Int32LE', 'Int32BE', - 'Float32LE', 'Float32BE', - 'Float64LE', 'Float64BE'], + type: types, millions: [1] }); |