psiho / jsbench-me

jsbench.me - JavaScript performance benchmarking playground
140 stars 2 forks source link

Precision #44

Closed reverofevil closed 3 years ago

reverofevil commented 3 years ago

Is there a way to set up better measurement precision (do more iterations to achieve higher p-value)?

psiho commented 3 years ago

JSBench.me is just a UI for benchmark.js. Investigating benchmark.js iterations i came to this post: https://stackoverflow.com/questions/32629779/define-number-of-cycles-benchmark-js

So it seems 2 conclusions can be drawn: 1) benchmark.js does not offer this option, and 2) it's avoided for a good reason.

reverofevil commented 3 years ago

It might be subjective, but I remember jsperf to use more iterations and produce better accuracy.

Even though the StackOverflow answer shows up as first result on Google search for "benchmark js precision", a further research shows that precision is controlled by maxTime parameter without affecting significance of the result.