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
Compare array access speed for an optimizable array which contains only numbers vs. a non-optimizable array that has an object in the first element and numbers in the rest.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
var a = [ 0 ], b = [ { valueOf: function() { return 0; } } ];
for( var i = 1; i < 1000000; ++i ) {
a[i] = b[i] = i;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Fast array |
| ready |
Slow array |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.