Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Normal Line vs Rectangle Line
canvas stuff
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0
Browser:
Firefox 129
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
FillRect
2813.6 Ops/sec
LineTo
1682.3 Ops/sec
HTML Preparation code:
<canvas id="c" width="800" height="300"></canvas>
Script Preparation code:
var c = document.getElementById('c'); var ctx = c.getContext('2d'); ctx.clearRect(0, 0, 800, 300); ctx.fillStyle = 'rgb(255,0,0)'; ctx.strokeStyle = 'rgb(255,0,0)';
Tests:
FillRect
for (var i = 0; i < 800; i++) { ctx.fillRect(i, 80, i+1, 1); }
LineTo
for (var i = 0; i < 800; i++) { ctx.beginPath(); ctx.moveTo(i,80); ctx.lineTo(i+1,80); ctx.stroke(); }