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
Draw some text into a canvas and read it back.
<script>
function makeContext(w, h) {
var canvas = document.createElement('canvas');
canvas.width = w;
canvas.height = h;
var ctx = canvas.getContext('2d');
ctx.font = '12px arial,san-serif'
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
return ctx;
}
var ctx = makeContext(1024,1024);
var ctx2 = makeContext(255, 64);
function runTest(context) {
context.fillText('a', 8, 8);
context.fillText('b', 16, 8);
context.fillText('c', 24, 8);
var data = context.getImageData(0,0,24,16);
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
bigCanvas |
| ready |
smallCanvas |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.