1
\$\begingroup\$

I have developed a game with easeljs for HTML5 Canvas. the game is a single HTML5 page with canvas and a lot of javascript.

All this time I tested the app on iOS Safari (iPad3 iOS7) with 40~50 fps via a local server. when I packed in a xcode app with phonegap, it becomes incredible slow near to 10fps.. I noticed the same behaviour when I added the page to homescreen.

There is any way to make make a good performance with html5 canvas app games for ipad (iOS7)?

\$\endgroup\$
3
\$\begingroup\$

My understanding is that Mobile Safari enables JIT compilation of JavaScript which is a pretty significant performance boost.

Due to security reasons, the JIT compilation is not available to a UIWebView within native apps, such as PhoneGap wrapped applications.

It seems that homescreen apps also run inside of the non-JIT UIWebView, although I read a few places that perhaps this restriction had been lifted recently.

Further reading:

\$\endgroup\$
  • 1
    \$\begingroup\$ Yes, this is a major drag on performance. One of my Canvas games runs at literally 1/4 the framerate when packaged as a phone gap app. \$\endgroup\$ – Mark Bessey Jan 19 '14 at 2:26
0
\$\begingroup\$

Ok, I found the solution for this.

The actual phonegap implementation uses default webViewer, which is quite slow. Ludei (www.ludei.com) has a great solution for HTML5 canvas high performance games, CocoonJS. It works great on iOS and Android, there is not for WindowsPhone. However there is no need for it on Windows Phone 8. Windows Phone 8 has the highest native HTML5 canvas performance I ever seen.

so Don't use Phonegap. Try CocoonJS!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.