Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
PutImageData vs DrawImage with getImageData in preparation code
GetImageData with PutImageData vs just DrawImage
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Browser:
Firefox 138
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
DrawImage whole master into di canvas
455747.1 Ops/sec
PutImageData whole master into pid canvas
263148.9 Ops/sec
HTML Preparation code:
<canvas id='master' width='100' height='100'></canvas> <canvas id='pid' width='100' height='100'></canvas> <canvas id='di' width='100' height='100'></canvas>
Script Preparation code:
var master = document.getElementById('master'); var masterctx = master.getContext('2d'); var pid = document.getElementById('pid').getContext('2d'); var di = document.getElementById('di').getContext('2d'); masterctx.fillRect(0,0,50,50); masterctx.fillStyle = "red"; masterctx.fillRect(50,50,100,100); let imgData = masterctx.getImageData(0,0,100,100);
Tests:
DrawImage whole master into di canvas
di.drawImage(master,0,0);
PutImageData whole master into pid canvas
pid.putImageData(imgData,0,0);