question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Comparison to previous results

See original GitHub issue

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” ?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
caderekcommented, Oct 22, 2019

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:

Case one: 0.22% faster
Other case: -2.50% slower
Average: -1.14% slower

https://gist.github.com/caderek/93394875730cc1b9f6750e527e7b9fcf

Hope this will help!

I will leave this issue open as a feature request.

1reaction
StoneCyphercommented, Dec 1, 2019

Please don’t paint issues. Make a new one instead

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interpreting Research Results with Previous Studies
Effective literature search is important for several reasons. Before you conduct your study, you need to identify other previous studies ...
Read more >
What to look for when comparing past and present survey results
The World's Research Marketplace ... Find, buy, and analyze third-party research from top providers. ... Often, one of the ways you decide how...
Read more >
Comparing your Results to the Previous Period in Q
While it is a fantastic feature, it only works if you have a Date question as the columns of the crosstab. You must...
Read more >
Comparison of results
Figure 2 shows an original smooth contour (above) from our test set and the generated contour using our prediction method (below) from the...
Read more >
Q: How I can compare my results with those of other studies in ...
The Discussion section provides an explanation and interpretation of the results or findings of your study by comparing them with the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found