Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
rgb vs rgba vs hex
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Browser:
Firefox 115
Operating system:
Windows 7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
alpha
10158.8 Ops/sec
no alpha
9934.8 Ops/sec
hex
8530.6 Ops/sec
HTML Preparation code:
<canvas id="canvasOne" width="400" height="400"></canvas> <canvas id="canvasTwo" width="400" height="400"></canvas> <canvas id="canvasThr" width="400" height="400"></canvas>
Script Preparation code:
var canvasOne = document.getElementById("canvasOne"); var ctxOne = canvasOne.getContext("2d"); var canvasTwo = document.getElementById("canvasTwo"); var ctxTwo = canvasTwo.getContext("2d"); var canvasThr = document.getElementById("canvasThr"); var ctxThr = canvasThr.getContext("2d");
Tests:
alpha
ctxTwo.fillStyle = 'rgba(255, 255, 255, 0.3)'; ctxTwo.fillRect(0, 0, 400, 400); ctxOne.beginPath(); ctxOne.fillStyle = 'rgba(255, 255, 255, 1)'; ctxOne.arc(200, 200, 100, 0, Math.PI * 2, true); ctxOne.fill();
no alpha
ctxTwo.fillStyle = 'rgba(255, 255, 255, 0.3)'; ctxTwo.fillRect(0, 0, 400, 400); ctxTwo.beginPath(); ctxTwo.fillStyle = 'rgb(255, 255, 255)'; ctxTwo.arc(200, 200, 100, 0, Math.PI * 2, true); ctxTwo.fill();
hex
ctxThr.fillStyle = 'rgba(255, 255, 255, 0.3)'; ctxThr.fillRect(0, 0, 400, 400); ctxThr.beginPath(); ctxThr.fillStyle = '#fff'; ctxThr.arc(200, 200, 100, 0, Math.PI * 2, true); ctxThr.fill();