summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5ae4976)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
--- /dev/null
+benchmark/results/
\ No newline at end of file
-const Benchmark = require('benchmark')
-const { LIST_FORMATTER, sleep } = require('./benchmark-utils')
-
-const suite = new Benchmark.Suite()
+const Benchmark = require('benny')
+const { sleep } = require('./benchmark-utils')
const timeout = 2000
const interval = 1000
const timeout = 2000
const interval = 1000
-suite
- .add('dummyTimeoutBusyWait', () => {
+Benchmark.suite(
+ 'Busy wait',
+ Benchmark.add('dummyTimeoutBusyWait', () => {
dummyTimeoutBusyWait(timeout)
dummyTimeoutBusyWait(timeout)
- })
- .add('sleepTimeoutBusyWait', async () => {
+ }),
+ Benchmark.add('sleepTimeoutBusyWait', async () => {
await sleepTimeoutBusyWait(timeout)
await sleepTimeoutBusyWait(timeout)
- })
- .add('divideAndConquerTimeoutBusyWait', async () => {
+ }),
+ Benchmark.add('divideAndConquerTimeoutBusyWait', async () => {
await divideAndConquerTimeoutBusyWait(timeout)
await divideAndConquerTimeoutBusyWait(timeout)
- })
- .add('setIntervalTimeoutBusyWait', () => {
+ }),
+ Benchmark.add('setIntervalTimeoutBusyWait', () => {
setIntervalTimeoutBusyWait(timeout)
setIntervalTimeoutBusyWait(timeout)
- })
- .on('cycle', event => {
- console.log(event.target.toString())
- })
- .on('complete', function () {
- console.log(
- 'Fastest is ' + LIST_FORMATTER.format(this.filter('fastest').map('name'))
- )
- // eslint-disable-next-line n/no-process-exit
- process.exit()
- })
- .run()
+ }),
+ Benchmark.cycle(),
+ Benchmark.complete(),
+ Benchmark.save({ file: 'busy-wait', format: 'json', details: true }),
+ Benchmark.save({ file: 'busy-wait', format: 'chart.html', details: true }),
+ Benchmark.save({ file: 'busy-wait', format: 'table.html', details: true })
+)
-const Benchmark = require('benchmark')
-const { LIST_FORMATTER } = require('./benchmark-utils')
-
-const suite = new Benchmark.Suite()
+const Benchmark = require('benny')
fibonacciRecursionMemoization(num - 2, memo))
}
fibonacciRecursionMemoization(num - 2, memo))
}
-suite
- .add('fibonacciLoop', () => {
+Benchmark.suite(
+ 'Fibonacci',
+ Benchmark.add('fibonacciLoop', () => {
- })
- .add('fibonacciRecursion', () => {
+ }),
+ Benchmark.add('fibonacciRecursion', () => {
fibonacciRecursion(number)
fibonacciRecursion(number)
- })
- .add('fibonacciRecursionMemoization', () => {
+ }),
+ Benchmark.add('fibonacciRecursionMemoization', () => {
fibonacciRecursionMemoization(number)
fibonacciRecursionMemoization(number)
- })
- .on('cycle', event => {
- console.log(event.target.toString())
- })
- .on('complete', function () {
- console.log(
- 'Fastest is ' + LIST_FORMATTER.format(this.filter('fastest').map('name'))
- )
- // eslint-disable-next-line n/no-process-exit
- process.exit()
- })
- .run()
+ }),
+ Benchmark.cycle(),
+ Benchmark.complete(),
+ Benchmark.save({ file: 'fibonacci', format: 'json', details: true }),
+ Benchmark.save({ file: 'fibonacci', format: 'chart.html', details: true }),
+ Benchmark.save({ file: 'fibonacci', format: 'table.html', details: true })
+)
"version": "0.0.1",
"license": "MIT",
"dependencies": {
"version": "0.0.1",
"license": "MIT",
"dependencies": {
"benny": "^3.7.1",
"microtime": "^3.1.1",
"uuid": "^9.0.0",
"benny": "^3.7.1",
"microtime": "^3.1.1",
"uuid": "^9.0.0",
"author": "jerome-benoit",
"license": "MIT",
"dependencies": {
"author": "jerome-benoit",
"license": "MIT",
"dependencies": {
"benny": "^3.7.1",
"microtime": "^3.1.1",
"uuid": "^9.0.0",
"benny": "^3.7.1",
"microtime": "^3.1.1",
"uuid": "^9.0.0",