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
<canvas id="canvas"></canvas>
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
const pathData = [];
for (var i = 0; i < 300; i += 5) {
pathData.push({ x: i, y: Math.random() * 150 });
}
const path = new Path2D();
for (var i = 0; i < pathData.length; i ++) {
var x = pathData[i].x;
var y = pathData[i].y;
path.lineTo(x, y);
}
context.clearRect(0, 0, canvas.width, canvas.height);
context.beginPath();
Ready to run.
Test | Ops/sec | |
---|---|---|
Reguar stroke |
| ready |
Path2D stroke |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.