HTML Preparation code:
Script Preparation code:
Tests:
  • fillRect using a concatenated color string

  • fillRect using a joined color string

  • fillRect with a template literal color string

  • fillRect with a constant color string

  • putImageData() using a 1px by 1px ImageData instance

  • Using drawImage to copy a pixel from a palette canvas

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    fillRect using a concatenated color string
    fillRect using a joined color string
    fillRect with a template literal color string
    fillRect with a constant color string
    putImageData() using a 1px by 1px ImageData instance
    Using drawImage to copy a pixel from a palette canvas

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: 14 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Chrome 123 on Windows
View result in a separate tab
Test name Executions per second
fillRect using a concatenated color string 1199.5 Ops/sec
fillRect using a joined color string 1153.0 Ops/sec
fillRect with a template literal color string 1199.7 Ops/sec
fillRect with a constant color string 2266.5 Ops/sec
putImageData() using a 1px by 1px ImageData instance 103.0 Ops/sec
Using drawImage to copy a pixel from a palette canvas 1016.4 Ops/sec