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
Benchmark different methods for looping a simple filter through image pixels.
<script>
var canvas = document.createElement('canvas');
canvas.width = 1024;
canvas.height = 1024;
var ctx = canvas.getContext('2d');
ctx.fillRect(0, 0, 1024, 1024);
var id = ctx.getImageData(0, 0, 1024, 1024);
var pixels = id.data;
var length = pixels.length;
var width = id.width;
var height = id.height;
</script>Ready to run.
| Test | Ops/sec | |
|---|---|---|
| property accesses 2d | | ready |
| property accesses 1d | | ready |
| local variables 2d | | ready |
| local variables 1d | | ready |
| local variables 1d hack one | | ready |
| local variables 1d hack two | | ready |
| local variables 1d hack three | | ready |
| local variables 2d cache-unfriendly | | ready |
| local variables 1d hack four | | ready |
| local variables 2d w/ bit-shifts | | ready |
| multiple getImageData calls | | ready |
| local variables 1d hack five | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.