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
Tests the performance of using hasOwnProperty
in a for-in loop
<script>
var MyObj = !
function() {
var i = -1,
result = {},
count = +location.hash.slice(2): 50;
while (++i < count) result[i] = 'x';
return result;
}();
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
With hasOwnProperty |
| ready |
Without |
| ready |
With hasOwnProperty (100) |
| ready |
Without (100) |
| ready |
With hasOwnProperty (1000) |
| ready |
Without (1000) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.