Skip to content

Commit

Permalink
πŸ“– changelog - πŸ†™πŸ“˜ examples
Browse files Browse the repository at this point in the history
  • Loading branch information
aretecode committed May 2, 2017
1 parent c39342c commit 0578e09
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
19 changes: 19 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# 0.4.1
- refactor reporting from Reporter, into
- PercentReporter
- GraphReporter
- TagReporter
- more jsdocs
- split out avggraphsinone until it works
- add spinner, split into UI
- split BenchChain out of index into a file
- split Results into a class
- add more subscribing methods
- simplify some ops
- convert to more chainable store methods
- add configstore option

# 0.4.0
- fix async reporting some properties only being added to last cycle, just added to all now (bigger data but simpler code)
- auto-progress bars

# 0.3.0
- add name to suite
- add more fluent
Expand Down
3 changes: 3 additions & 0 deletions docs/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
https://gist.github.com/springmeyer/a67d8d77057d30fc4bbe
https://mathiasbynens.be/notes/javascript-benchmarking
https://github.com/JamieMason/karma-benchmark/blob/master/src/run-benchmarks.js
https://github.com/avajs/ava/issues/816
https://github.com/avajs/ava/blob/master/bench/compare.js
https://benchmarkjs.com/docs#prototype_compare
20 changes: 15 additions & 5 deletions example/asyncs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@ const Bench = require('../')
const sleep = sleepDuration =>
new Promise(resolve => setTimeout(resolve, sleepDuration))

/* prettier-ignore */

Bench
.init().dir(__dirname).filename('asyncs.json').setup()
.name('sleepy')
.tags('v1,v2')
.init().dir(__dirname).filename('asyncs4.json').setup()
.name('sleepy4')
.tags('fresh,MORETAGS,uniqd,4th')

// can also use .add, and then .runAsync()
.addAsync('sleep1', async done => {
await sleep(1000)
await sleep(100)
done()
})
.addAsync('sleep2', async done => {
await sleep(2000)
await sleep(200)
done()
})
// .addAsync('sleep3', async done => {
// await sleep(300)
// done()
// })
.addAsync('sleep200 4', async done => {
await sleep(200)
done()
})
.run()
13 changes: 13 additions & 0 deletions example/configstore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const Bench = require('../src')

Bench
// location to store benchmarks
// .init(__dirname, 'configstore.basic.json')
.init(__dirname, 'basic-configstore.json')
.name('configstore-basic')
// tag current benchmarks with, to mark what changes caused differences
.tags('v0.4.1,configstore')
// actual benchmarks
.add('1 * 1', () => 1 * 1)
.add('1 + 1', () => 1 + 1)
.run()

0 comments on commit 0578e09

Please sign in to comment.