Context2D self-drawImage (v2)

Revision 2 of this benchmark created on


Setup

var canvas1 = document.createElement('canvas')
;
var canvas2 = document.createElement('canvas')
;
for (var canvas of [canvas1, canvas2]) {
	canvas.width = 256;
	canvas.height = 256;
}

const opts = {
	alpha: false,
};
var cx1 = canvas1.getContext('2d', opts);
var cx2 = canvas2.getContext('2d', opts);

for (var cx of [cx1, cx2]) {
	cx.globalCompositeOperation = 'copy';
}

Test runner

Ready to run.

Testing in
TestOps/sec
drawImage(self)
cx1.drawImage(canvas1, 1, 1);
ready
drawImage(other)
cx1.drawImage(canvas2, 1, 1);
ready
drawImage(self) by ping-pong
cx2.drawImage(canvas1, 0, 0);
cx1.drawImage(canvas2, 1, 1);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.