Open
Description
A lot of our benchmark code looks like this:
before(() => {
// ...
});
run(() => {
const store = new Store();
store.runLots();
// do something
})
Since the store.runLots()
(or store.run()
) is in the run()
hook, we are measuring the cost of allocating a large array of data (in this case, a 10k array). This pointlessly increases the measured time with something that we effectively don't control.
We should move the store-building logic into the before()
hook.
Activity