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 Object.keys vs for-in. I see that SlickGrid uses objects with indexed keys rather than arrays. Confused....
<script>
window.keys = Object.keys
window.ownp = Object.prototype.hasOwnProperty
window.count = function(){return 200000};
window.data = {};
for (var remain = count(); remain; --remain) {
data[remain] = 1;
}
window.minObject = {'solo': 'all alone'};
window.decVar = 10000000;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Simple For-In |
| ready |
w/ Own Property Check |
| ready |
Using Object Keys (For) |
| ready |
Using Object Keys (While) |
| ready |
Min Time to get Keys |
| ready |
Min Time to Initialize Loop |
| ready |
Min Time to Initialize While |
| ready |
Time to Get More Keys |
| ready |
Time to Do For Loop |
| ready |
Time to Do While Loop |
| ready |
Time to Decrement |
| ready |
Initialize a Variable |
| ready |
Init and Set a Variable |
| ready |
Assume Dense Numerically Indexed Obj |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.