Open
Description
The first bench
call always seems to be slower than other tests. I've included a simple test case below.
benchmark.js:
require('matcha');
[1, 2, 3, 4].forEach((num) => {
suite(`Benchmark #${num}`, () => {
bench('empty', () => {});
bench('empty', () => {});
});
});
command line:
npm install -g matcha
matcha ./benchmark.js
output:
Benchmark #1
414,441,918 op/s » empty
126,934,245 op/s » empty
Benchmark #2
130,458,368 op/s » empty
132,597,178 op/s » empty
Benchmark #3
132,507,794 op/s » empty
131,705,064 op/s » empty
Benchmark #4
135,100,324 op/s » empty
131,982,266 op/s » empty
Suites: 4
Benches: 8
Elapsed: 10,695.31 ms
I would expect all the benchmarks to execute around the same amount of time.
Thanks for this library btw!
Metadata
Metadata
Assignees
Labels
No labels