Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
drawImage() scaling down performance with no smoothing
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Browser:
Chrome 128
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Scaling from a large canvas area to a large canvas area (no scaling)
20/s
Scaling from a large canvas area to a medium canvas area
17/s
Scaling from a large canvas area to a small canvas area
12/s
View exact numbers
Test name
Executions per second
✓
Scaling from a large canvas area to a large canvas area (no scaling)
20 Ops/sec
Scaling from a large canvas area to a medium canvas area
17 Ops/sec
Scaling from a large canvas area to a small canvas area
12 Ops/sec
Script Preparation code:
$sourceWidth = 3000; $sourceHeight = 3000; $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 = $sourceWidth; $destCanvas.height = $sourceHeight; $destContext = $destCanvas.getContext("2d"); $destContext.imageSmoothingEnabled = false;
Tests:
Scaling from a large canvas area to a small canvas area
$destContext.drawImage($sourceCanvas, 0, 0, $sourceWidth, $sourceHeight, 0, 0, 100, 100); // Force the drawImage call to be evaluated within this benchmark code: $destContext.getImageData(0, 0, 1, 1);
Scaling from a large 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 large canvas area to a large 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);