jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
FOR THE LOVE OF ALL THAT IS GOOD DO NOT SHUFFLE ARRAYS TO SELECT AN ITEM FROM IT.
function shuffle(a)
{
var j, x, i;
for (i = a.length;i;i--)
{
j = Math.floor(Math.random() * i);
x = a[i - 1];
a[i - 1] = a[j];
a[j] = x;
}
return a;
}
function select_random(a) {
return a[Math.floor(Math.random() * a.length)];
}
var RESULT = null;
Ready to run.
Test | Ops/sec | |
---|---|---|
Shuffle |
| ready |
Select random |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.