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
var f = ['abc', 'def', 'ghi', 'jkl', 'mno', 'pqr', 'stu', 'vwx', 'yza'];
// From: https://github.com/eligrey/classList.js/blob/master/classList.js
function indexOf_eg(item) {
var
i = 0,
len = this.length;
for (; i < len; i++) {
if (i in this && this[i] === item) {
return i;
}
}
return -1;
};
// from: http://webreflection.blogspot.fr/2011/06/partial-polyfills.html
function indexOf_ag(value) {
for (var i = this.length; i-- && this[i] !== value;) {}
return i;
};
var indexOf_ch = Array.prototype.indexOf;
Ready to run.
Test | Ops/sec | |
---|---|---|
method 1 (Eli Grey) |
| ready |
method 2 (Andrea Giammarchi) |
| ready |
Chrome's indexOf in var |
| ready |
Chrome's indexOf |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.