Canvas optimization trick – avoid put/getImage calls unless necessary

Thanks to the power of google and some very explicit search terms, I stumbled upon this ( ) valuable tip.

Inside Ping, my implementation of putPixel uses either a fillRect or arc path because I’d already found making direct writes to the canvas pixel array terrifyingly expensive.

Next up for Ping is to use multiple canvas’s to store static images ( examples background layout ) and see how that works out.