I am developing a game for html5 canvas while mainly targeting mobile devices. The canvas is resized to the biggest available resolution, so that it almost makes a fullscreen ga
You can read Making an iPad HTML5 App & making it really fast by Thomas Fuchs
The key points he make:
text-shadow
& box-shadow
opacity
if possible (sometimes interferes with hardware-accelerated rendering)translate3d
, not translate
(the latter is not hard-accelerated)Some other points that can improve performance significantly:
getImageData
as infrequently as possible (major slowdown) [2]You can also benchmark your app with Chrome/Firebug Profile can show you which functions are slow.
[2] http://ajaxian.com/archives/canvas-image-data-optimization-tip
Also see this canvas performance optimization article on html5rocks, which contains jsperf data which includes mobile browsers.
A couple of more links:
It's hard to give any specific tips as I'm not familiar enough with your game. You might want to split up rendering to multiple layers, though. This makes sense particularly if you have some static elements there. This way you can avoid some clearing and end up with nicer code overall.