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="result"></div>
<script>
var doc = document.getElementById("result");
var c = document.createElement('canvas');
var ctx = c.getContext('2d');
c.width = 200;
c.height = 200;
doc.appendChild(c);
var smallcvs = document.createElement('canvas');
var ctx2 = smallcvs.getContext('2d');
smallcvs.width = 128;
smallcvs.height = 128;
doc.appendChild(smallcvs);
ctx2.fillStyle = 'red';
ctx2.fillRect(16, 16, 96, 96);
var smallimg = new Image();
smallimg.src = smallcvs.toDataURL();
var bigcvs = document.createElement('canvas');
var ctx2 = bigcvs.getContext('2d');
doc.appendChild(bigcvs);
bigcvs.width = 2560;
bigcvs.height = 2560;
ctx2.fillRect(116, 116, 96, 96);
var bigimg = new Image();
bigimg.src = bigcvs.toDataURL();
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
drawImage whole image |
| ready |
drawImage whole canvas |
| ready |
drawImage image section |
| ready |
drawImage canvas section |
| ready |
draw image with translation |
| ready |
draw canvas with translation |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.