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
This revision is a subset of the full suite at revision 2 with only the 8 most performant loops and each test limited to a max time of 2 seconds.
This is because https://browserlab.adobe.com has a max timeout of 20 seconds before it takes a screenshot. If we want to use that tool to help test many browsers at once it has to be complete within that time.
There is also http://browsercam.com, which has a max timeout of 30 seconds.
Please note the scope of this test suite is to only test native JavaScript loop constructs, not utilities such as $.each, _.each etc. They will be covered by other suites.
This test suite is to provide data for this JavaScript loop optimising GitHub project, more information is available on the GitHub page, thanks.
Jamie Mason (@GotNoSugarBaby)
<script>
Benchmark.options.maxTime = 2;
var arr = [], obj = {};
(function ()
{
for( var i = 0; i < 1000; i++ ) {
arr[i] = 'value' + i;
obj[i] = 'value' + i;
}
}());
function someFn (ix)
{
return ix * 5 + 1 / 3 * 8;
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
while, counting down |
| ready |
while, counting down (2) |
| ready |
while, counting down (3) |
| ready |
for, counting down |
| ready |
while i < arr.length (with caching) |
| ready |
for i < arr.length (without caching) |
| ready |
for i < arr.length (with caching) |
| ready |
while i < arr.length (without caching) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.