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
Testing if access through Array.indexOf or Object's in Operator is faster.
var arr = [], obj = {};
for (var i=0; i<=10000; i++){
arr[i] = obj[i] = null;
}
arr[0] = 'first';
arr[10000] = 'last';
delete obj[0];
delete obj[10000];
obj.first = obj.last = 'null';
Ready to run.
Test | Ops/sec | |
---|---|---|
Array - Find first |
| ready |
Array - Find last |
| ready |
Array - Find nonexistent |
| ready |
Object - Test first |
| ready |
Object - Test last |
| ready |
Object - Test nonexistent |
| ready |
Object - Find first |
| ready |
Object - Find last |
| ready |
Object - Find nonexistent |
| ready |
Object - Typeof first against undefined |
| ready |
Object - Typeof last against undefined |
| ready |
Object - Typeof nonexistent against undefined |
| ready |
Object - Test first against undefined |
| ready |
Object - Test last against undefined |
| ready |
Object - Test nonexistent against undefined |
| ready |
Object - Test first against undefined with attr access |
| ready |
Object - Test last against undefined with attr access |
| ready |
Object - Test nonexistent against undefined with attr access |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.