Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Chrome 136
Mac OS X 10.15.7
Desktop
one year ago
Render directly with ctx.fillRect()
52K/s
Render Path2D
38K/s
Create instances of Path2D
37K/s
Render offscreen canvases
11K/s
Create instances of offscreen canvas
102/s
View exact numbers
Test name Executions per second
Render directly with ctx.fillRect() 51,750 Ops/sec
Render Path2D 38,285 Ops/sec
Create instances of Path2D 36,666 Ops/sec
Render offscreen canvases 10,567 Ops/sec
Create instances of offscreen canvas 102 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: