rapidash icon indicating copy to clipboard operation
rapidash copied to clipboard

Benchmark results not consistent ?

Open hasangenc0 opened this issue 5 years ago • 4 comments

When I write my solution on the top of the other solutions the winner becomes my solution.

Code Result

But if I write my solution after others the winner is changing.

Code Result

Even if I write my solution twice the results are different.

Code Result

The results actually can be normal because of the behavior of this kind of performance analysis. I'm just wondering these tests are reliable. Maybe the usage of Benchmark.prototype.hz is wrong 🤔

hasangenc0 avatar Feb 08 '20 11:02 hasangenc0

Actually its quite normal since the solutions are pretty close to each other. However, since the solutions are tested in dockerized environment it would minimize the difference

yavuzkoca avatar Feb 08 '20 12:02 yavuzkoca

It is right but the problem is when I right my solution at the top "always" my solution wins and if I write the bottom the winner is changing. And the difference between these even between the duplicate solutions is 2x.

hasangenc0 avatar Feb 08 '20 12:02 hasangenc0

I don't think that it would depend order of the solutions but maybe there is a glitch

yavuzkoca avatar Feb 08 '20 16:02 yavuzkoca

I am not sure if this is a bug, I will investigate this.

Acanguven avatar Feb 09 '20 13:02 Acanguven