Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Canvas restore or retranslate
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0
Browser:
Firefox 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
restore
1483601.9 Ops/sec
retranslate
1435987.4 Ops/sec
HTML Preparation code:
<canvas id='canvas' width='1000' height='1000'></canvas>
Script Preparation code:
var el = document.getElementById('canvas'); let ctx = el.getContext("2d");
Tests:
restore
ctx.save(); ctx.translate(500, 500) ctx.beginPath() ctx.moveTo(500, 500) ctx.lineTo(600, 600) ctx.stroke(); ctx.restore()
retranslate
ctx.translate(500, 500) ctx.beginPath() ctx.moveTo(500, 500) ctx.lineTo(600, 600) ctx.stroke(); ctx.translate(-500, -500)