Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
drawImage vs draw path
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Browser:
Chrome 135
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Sroke path
928099.6 Ops/sec
draw saved canvas
30158.6 Ops/sec
HTML Preparation code:
<canvas id="canvas" width="1024" height="1024"></canvas> <canvas id="backCanvas" width="1024" height="1024"></canvas>
Script Preparation code:
const canvas = document.getElementById('canvas') const backCanvas = document.createElement('canvas') backCanvas.width = canvas.width backCanvas.height = canvas.height const ctx = canvas.getContext('2d') const backCtx = backCanvas.getContext('2d') const path = new Path2D(); for(const i = 0; i < canvas.width; i+=5) { path.moveTo(i, 0) path.lineTo(i, w) } for(const i = 0; i < canvas.height; i+=5) { path.moveTo(0, i) path.lineTo(h, i) } backCtx.stroke(path)
Tests:
Sroke path
ctx.stroke(path)
draw saved canvas
ctx.drawImage(backCanvas, 0, 0)