Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15
Safari 14
Mac OS X 10.14.6
Desktop
4 years ago
Test name Executions per second
fillRect/concat 94.1 Ops/sec
fillRect/join 87.5 Ops/sec
1×1 Image Data 35.7 Ops/sec
fillRect/template literal 87.0 Ops/sec
getImageData/putImageData 410.8 Ops/sec
getImageData/putImageData - set px.rgba 341.8 Ops/sec
getImageData/putImageData - set [px.r, px.g, px.b, px.a] 333.3 Ops/sec
getImageData/putImageData - set - no getImageData 288.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • fillRect/concat

  • fillRect/join

  • 1×1 Image Data

  • fillRect/template literal

  • getImageData/putImageData

  • getImageData/putImageData - set px.rgba

  • getImageData/putImageData - set [px.r, px.g, px.b, px.a]

  • getImageData/putImageData - set - no getImageData