Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
fillRect vs rect
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0
Browser:
Firefox 120
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
fillRect
710884.3 Ops/sec
rect
122701.2 Ops/sec
HTML Preparation code:
<canvas width="500" height="500"></canvas>
Script Preparation code:
var ctx = document.querySelector('canvas').getContext('2d');
Tests:
fillRect
ctx.fillStyle = '#'+(Math.random() * 0xFFFFFF << 0).toString(16).padStart(6, '0'); ctx.fillRect(Math.random() * 500, Math.random() * 500, Math.random() * 50, Math.random() * 50);
rect
ctx.beginPath(); ctx.rect(Math.random() * 500, Math.random() * 500, Math.random() * 50, Math.random() * 50); ctx.fillStyle = '#'+(Math.random() * 0xFFFFFF << 0).toString(16).padStart(6, '0'); ctx.fill();