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="canvas1" width="26" height="26"></canvas>
<canvas id="canvas2" width="26" height="26"></canvas>
<script>
var can = document.getElementById('canvas1');
var ctx = can.getContext('2d');
var can3 = document.getElementById('canvas2');
var ctx3 = can.getContext('2d');
var can2 = document.createElement('canvas');
var ctx2 = can2.getContext('2d');
var can22 = document.createElement('canvas');
var ctx22 = can22.getContext('2d');
function drawMinusPlus(ctx, color, lineColor, isPlus, size) {
var radius = 12;
var lineStart = 6;
var lineLength = 20;
if (size == 'small') {
radius = 10;
lineStart = 8;
lineLength = 18;
}
if (!lineColor)
lineColor = "#FFFFFF";
ctx.clearRect(0, 0, 26, 26);
ctx.restore();
ctx.save();
ctx.beginPath();
ctx.fillStyle = ctx.strokeStyle = color;
ctx.arc(13, 13, radius, 0, 2 * Math.PI);
ctx.fill();
ctx.beginPath();
ctx.lineWidth = 2;
ctx.strokeStyle = lineColor;
ctx.moveTo(lineStart, 13);
ctx.lineTo(lineLength, 13);
ctx.stroke();
if (isPlus == "true") {
ctx.moveTo(13, lineStart);
ctx.lineTo(13, lineLength);
ctx.stroke();
}
ctx.closePath();
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
render |
| ready |
pre-rendered |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.