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()
41K/s
Create instances of Path2D
40K/s
Render Path2D
35K/s
Render offscreen canvases
11K/s
Create instances of offscreen canvas
100/s
View exact numbers
Test name Executions per second
Render directly with ctx.fillRect() 41,370 Ops/sec
Create instances of Path2D 40,268 Ops/sec
Render Path2D 35,191 Ops/sec
Render offscreen canvases 10,583 Ops/sec
Create instances of offscreen canvas 100 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: