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
// http://stackoverflow.com/a/2450976/5482384
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex ;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
// And swap it with the current element.
temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}
return array;
}
var obj = [{
id: 0,
num: 20
}, {
id: 1,
num: 20
}, {
id: 2,
num: 20
}, {
id: 3,
num: 20
}, {
id: 4,
num: 20
}, {
id: 5,
num: 20
}, {
id: 6,
num: 20
}, {
id: 7,
num: 20
}, {
id: 8,
num: 20
}, {
id: 9,
num: 20
}, {
id: 10,
num: 20
}, {
id: 11,
num: 20
}, {
id: 12,
num: 20
}, {
id: 13,
num: 20
}, {
id: 14,
num: 20
}, {
id: 15,
num: 20
}, {
id: 16,
num: 20
}, {
id: 17,
num: 20
}, {
id: 18,
num: 20
}, {
id: 19,
num: 20
}, {
id: 20,
num: 50
}, {
id: 21,
num: 50
}, {
id: 22,
num: 50
}, {
id: 23,
num: 50
}, {
id: 24,
num: 50
}, {
id: 25,
num: 50
}, {
id: 26,
num: 50
}, {
id: 27,
num: 50
}, {
id: 28,
num: 50
}, {
id: 29,
num: 50
}, {
id: 30,
num: 50
}, {
id: 31,
num: 50
}, {
id: 32,
num: 50
}, {
id: 33,
num: 50
}, {
id: 34,
num: 50
}, {
id: 35,
num: 50
}, {
id: 36,
num: 50
}, {
id: 37,
num: 50
}, {
id: 38,
num: 50
}, {
id: 39,
num: 50
}, {
id: 40,
num: 50
}, {
id: 41,
num: 50
}, {
id: 42,
num: 50
}, {
id: 43,
num: 50
}, {
id: 44,
num: 50
}, {
id: 45,
num: 50
}, {
id: 46,
num: 50
}, {
id: 47,
num: 50
}, {
id: 48,
num: 50
}, {
id: 49,
num: 50
}, {
id: 50,
num: 80
}, {
id: 51,
num: 80
}, {
id: 52,
num: 80
}, {
id: 53,
num: 80
}, {
id: 54,
num: 80
}, {
id: 55,
num: 80
}, {
id: 56,
num: 80
}, {
id: 57,
num: 80
}, {
id: 58,
num: 80
}, {
id: 59,
num: 80
}, {
id: 60,
num: 80
}, {
id: 61,
num: 80
}, {
id: 62,
num: 80
}, {
id: 63,
num: 80
}, {
id: 64,
num: 80
}, {
id: 65,
num: 80
}, {
id: 66,
num: 80
}, {
id: 67,
num: 80
}, {
id: 68,
num: 80
}, {
id: 69,
num: 80
}, {
id: 70,
num: 80
}, {
id: 71,
num: 80
}, {
id: 72,
num: 80
}, {
id: 73,
num: 80
}, {
id: 74,
num: 80
}, {
id: 75,
num: 80
}, {
id: 76,
num: 80
}, {
id: 77,
num: 80
}, {
id: 78,
num: 80
}, {
id: 79,
num: 80
}, {
id: 80,
num: 100
}, {
id: 81,
num: 100
}, {
id: 82,
num: 100
}, {
id: 83,
num: 100
}, {
id: 84,
num: 100
}, {
id: 85,
num: 100
}, {
id: 86,
num: 100
}, {
id: 87,
num: 100
}, {
id: 88,
num: 100
}, {
id: 89,
num: 100
}, {
id: 90,
num: 100
}, {
id: 91,
num: 100
}, {
id: 92,
num: 100
}, {
id: 93,
num: 100
}, {
id: 94,
num: 100
}, {
id: 95,
num: 100
}, {
id: 96,
num: 100
}, {
id: 97,
num: 100
}, {
id: 98,
num: 100
}, {
id: 99,
num: 100
}];
function use(x) {
return x;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
filter |
| ready |
loop |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.