X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=quick-select.mjs;h=49dc7057b5c70d30ad5894169cabfd02df409516;hb=bf2f087f3d30a4d8437a38b77cd0ae6f6f7da830;hp=a829a9e52032966d969338efcbd1ddc56d08a495;hpb=0c01f51c5673eefd485edfab3f8cea93a56f400e;p=benchmarks-js.git diff --git a/quick-select.mjs b/quick-select.mjs index a829a9e..49dc705 100644 --- a/quick-select.mjs +++ b/quick-select.mjs @@ -1,6 +1,6 @@ import { randomInt } from 'node:crypto' -import Benchmark from 'benny' +import { bench, group, run } from 'tatami-ng' /** * @param numberOfWorkers @@ -228,41 +228,27 @@ function quickSelectRecursionRandomPivot (tasksMap) { ) } -Benchmark.suite( - 'Quick select', - Benchmark.add('Loop select', () => { +group('Quick select', () => { + bench('Loop select', () => { loopSelect(tasksMap) - }), - Benchmark.add('Array sort select', () => { + }) + bench('Array sort select', () => { arraySortSelect(tasksMap) - }), - Benchmark.add('Quick select loop', () => { + }) + bench('Quick select loop', () => { quickSelectLoop(tasksMap) - }), - Benchmark.add('Quick select loop with random pivot', () => { + }) + bench('Quick select loop with random pivot', () => { quickSelectLoopRandomPivot(tasksMap) - }), - Benchmark.add('Quick select recursion', () => { + }) + bench('Quick select recursion', () => { quickSelectRecursion(tasksMap) - }), - Benchmark.add('Quick select recursion with random pivot', () => { + }) + bench('Quick select recursion with random pivot', () => { quickSelectRecursionRandomPivot(tasksMap) - }), - Benchmark.cycle(), - Benchmark.complete(), - Benchmark.save({ - file: 'quick-select', - format: 'json', - details: true - }), - Benchmark.save({ - file: 'quick-select', - format: 'chart.html', - details: true - }), - Benchmark.save({ - file: 'quick-select', - format: 'table.html', - details: true }) -).catch(console.error) +}) + +await run({ + units: true +})