Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
DrawStroke bench
(version: 0)
stroke with clip vs no, rounded or not, vs cached
Comparing performance of:
Cached vs draw rect rounded vs draw rect not rounded vs rect clipped
Created:
3 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<canvas id='master' width='100' height='100'></canvas> <canvas id='cached' width='100' height='100'></canvas>
Script Preparation code:
var master = document.getElementById('master'); var masterctx = master.getContext('2d'); var cached = document.getElementById('cached'); var cachedctx = master.getContext('2d'); cachedctx.strokeRect(0, 0, 100, 100)
Tests:
Cached
masterctx.drawImage(cached,0,0);
draw rect rounded
cachedctx.strokeRect(0, 0, 100, 100)
draw rect not rounded
masterctx.strokeRect(0.5,0.5, 99.5, 99.5);
rect clipped
masterctx.save(); const region = new Path2D(); region.rect(0, 0, 100, 100); masterctx.clip(region, 'evenodd'); masterctx.lineWidth = 2; masterctx.strokeRect(0, 0, 100, 100); masterctx.restore();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
Cached
draw rect rounded
draw rect not rounded
rect clipped
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
drawing cached vs live
cache vs live
fill/stroke Path2D vs repeated path drawing calls
DrawStroke bench radius
Comments
Confirm delete:
Do you really want to delete benchmark?