Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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; rv:121.0) Gecko/20100101 Firefox/121.0
Browser:
Firefox 121
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
Scaling from a small canvas area to a medium canvas area
49/s
Scaling from a small canvas area to a small canvas area (no scaling)
48/s
Scaling from a small canvas area to a large canvas area
42/s
View exact numbers
Test name
Executions per second
✓
Scaling from a small canvas area to a medium canvas area
49 Ops/sec
Scaling from a small canvas area to a small canvas area (no scaling)
48 Ops/sec
Scaling from a small canvas area to a large canvas area
42 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);