Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
drawImage() scaling up performance
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Browser:
Chrome 109
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Scaling from a small canvas area to a small canvas area (no scaling)
1.2 Ops/sec
Scaling from a small canvas area to a medium canvas area
1.3 Ops/sec
Scaling from a small canvas area to a large canvas area
1.2 Ops/sec
Script Preparation code:
$sourceWidth = 100; $sourceHeight = 100; $sourceCanvas = document.createElement("canvas"); $sourceCanvas.width = $sourceWidth; $sourceCanvas.height = $sourceHeight; $sourceContext = $sourceCanvas.getContext("2d"); $sourceContext.fillStyle = "rgba(0,100,200,1)"; $sourceContext.fillRect(0, 0, $sourceWidth, $sourceHeight); $destCanvas = document.createElement("canvas"); $destCanvas.width = 3000; $destCanvas.height = 3000; $destContext = $destCanvas.getContext("2d");
Tests:
Scaling from a small canvas area to a small canvas area (no scaling)
$destContext.drawImage($sourceCanvas, 0, 0, $sourceWidth, $sourceHeight, 0, 0, $sourceWidth, $sourceHeight); // Force the drawImage call to be evaluated within this benchmark code: $destContext.getImageData(0, 0, 1, 1);
Scaling from a small canvas area to a medium canvas area
$destContext.drawImage($sourceCanvas, 0, 0, $sourceWidth, $sourceHeight, 0, 0, 600, 600); // Force the drawImage call to be evaluated within this benchmark code: $destContext.getImageData(0, 0, 1, 1);
Scaling from a small canvas area to a large canvas area
$destContext.drawImage($sourceCanvas, 0, 0, $sourceWidth, $sourceHeight, 0, 0, 3000, 3000); // Force the drawImage call to be evaluated within this benchmark code: $destContext.getImageData(0, 0, 1, 1);