HTML Preparation code:
AخA
 
1
<canvas id='master' width='500' height='500'></canvas>
2
<canvas id='pid' width='200' height='200'></canvas>
3
<canvas id='di' width='200' height='200'></canvas>
Script Preparation code:
x
 
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);
Tests:
  • DrawImage

     
    di.drawImage(master,0,0);
  • DrawImage (subrectangle)

     
    di.drawImage(master,0,0,200,200,0,0,200,200);
  • PutImageData

     
    let imgData = masterctx.getImageData(0,0,500,500);
    pid.putImageData(imgData,0,0);
  • PutImageData (subrectangle)

     
    let imgData = masterctx.getImageData(0,0,200,200);
    pid.putImageData(imgData,0,0);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    DrawImage
    DrawImage (subrectangle)
    PutImageData
    PutImageData (subrectangle)

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
DrawImage 694427.1 Ops/sec
DrawImage (subrectangle) 705198.9 Ops/sec
PutImageData 1470.3 Ops/sec
PutImageData (subrectangle) 8690.5 Ops/sec