Instead of writing directly to the main canvas, we should write to an offscreen canvas, and then when all the rendering is done copy that on the main canvas. This may be faster than what we are currently doing
Information on this is conflicting: https://stackoverflow.com/questions/2795269/does-html5-canvas-support-double-buffering