HTML Preparation code:
AخA
 
1
<canvas id="canvas" width="400" height="400"></canvas>
Script Preparation code:
x
 
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext("2d");
var cacheG = document.createElement('canvas');
var cacheD = cacheG.getContext('2d');
cacheG.width = 12;
cacheG.height = 12;
cacheD.beginPath();
cacheD.fillStyle = '#000';
cacheD.arc(6, 6, 6, 0, Math.PI * 2, true);
cacheD.fill();
var d = cacheD.getImageData(0,0,12,12)
Tests:
  • drawImage

     
    ctx.drawImage(cacheG, 6, 6);
  • putImageData

     
    ctx.putImageData(d, 6, 6);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    drawImage
    putImageData

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Chrome 122 on Windows
View result in a separate tab
Test name Executions per second
drawImage 700736.4 Ops/sec
putImageData 28590.9 Ops/sec