-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comparison to previous results #7
Comments
I'm planning to add this, but it is not ready yet. In the meanwhile you can use this script to diff two versions of the JSON results: /* diff.js */
const fs = require('fs')
const fileA = JSON.parse(fs.readFileSync(process.argv[2]).toString())
const fileB = JSON.parse(fs.readFileSync(process.argv[3]).toString())
const diffs = fileB.results.map((resultB) => {
const oldResult = fileA.results.find(
(resultA) => resultA.name === resultB.name,
)
if (!oldResult) {
return { name: resultB.name, diff: null }
}
const diff = ((resultB.ops - oldResult.ops) / oldResult.ops) * 100
return {
name: resultB.name,
diff,
}
})
console.log(
diffs
.map(
({ name, diff }) =>
`${name}: ${diff.toFixed(2)}% ${
diff > 0 ? 'faster' : diff < 0 ? 'slower' : 'same'
}`,
)
.join('\n'),
)
const changed = diffs.filter((item) => item.diff !== null)
const average = changed.reduce((a, b) => a + b.diff, 0) / changed.length
console.log(
`Average: ${average.toFixed(2)}% ${
average > 0 ? 'faster' : average < 0 ? 'slower' : 'same'
}`,
) Usage: node diff.js path/to/oldBench.json path/to/newBench.json Example output:
https://gist.github.com/caderek/93394875730cc1b9f6750e527e7b9fcf Hope this will help! I will leave this issue open as a feature request. |
Wow I just now saw this Ya this is actually pretty great |
Any way to show results in a line graph? i.e. store to a .json and track historic |
Please don't paint issues. Make a new one instead |
@caderek What's the current status for this enhancement? |
Does
benny
have any mechanism to compare this benchmark to my last round, so that I can say something of the form "in this release the library is on average 2% faster" ?The text was updated successfully, but these errors were encountered: