X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=empty-array.js;h=c900a4239e4e4a04f17a5b92e3cadebb5d91377c;hb=849dea15d1cef675a9418c9306c715a3e0b92036;hp=52f836e5f474b31f6c578291e9920a89d1f9df6a;hpb=e2bfb54955f0d0138b5c83a918c96112a5710d52;p=benchmarks-js.git diff --git a/empty-array.js b/empty-array.js index 52f836e..c900a42 100644 --- a/empty-array.js +++ b/empty-array.js @@ -1,10 +1,11 @@ const Benchmark = require('benny') -const { generateRandomIntegerArray } = require('./benchmark-utils') +const { generateRandomNumberArray } = require('./benchmark-utils') -let testArray = generateRandomIntegerArray(10000) +const size = 10000 +let testArray = generateRandomNumberArray(size) Benchmark.suite( - 'Empty array', + `Empty array with ${size} elements`, Benchmark.add('length = 0', () => { testArray.length = 0 }), @@ -29,4 +30,6 @@ Benchmark.suite( Benchmark.save({ file: 'empty-array', format: 'json', details: true }), Benchmark.save({ file: 'empty-array', format: 'chart.html', details: true }), Benchmark.save({ file: 'empty-array', format: 'table.html', details: true }) -) +).catch(err => { + console.error(err) +})