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
<div id="a"></div>
<div id="wrapper">
<div id="el-1"></div>
<div id="el-2"></div>
<div id="el-3"></div>
</div>
<canvas></canvas>
<script>
var ctx = document.querySelector('canvas').getContext('2d'),
doc = document,
tmp, tmp2 = '',
tmp3 = '',
tmp4 = 1,
tmp5 = 1,
wnd = window,
$wrapper = document.querySelector('#wrapper'),
$el1 = document.querySelector('#el-1'),
$el2 = document.querySelector('#el-2'),
$el3 = document.querySelector('#el-3'),
a1 = [1, 2, 3, 4, 5, 6, 7, 8, 9],
a2 = [1, 2, 3, 4, 5, 6, 7, 8, 9],
i, c;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
[A] getting global var |
| ready |
[B] getting local var |
| ready |
[A] getting element by id |
| ready |
[B] getting element by tag name |
| ready |
[A] unoptimized reflow |
| ready |
[B] optimized reflow |
| ready |
[A] string concat via + |
| ready |
[B] string concat via concat |
| ready |
[A] mul 2 |
| ready |
[B] lsh 1 |
| ready |
[A] slow selector |
| ready |
[B] slow selector |
| ready |
[C] fast selector with cache |
| ready |
[A] loop unoptimized |
| ready |
[B] loop optimized |
| ready |
[C] loof foreach |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.