View
 

Performance tips for device

Page history last edited by rborn 3 years ago

I hope this page to be in time a sum of performances tips for the actual device, as it is known that the simulator runs much faster than the device.

Please note that I only use the iPhone part of PhoneGap, but should be universal.

 

1. Do not use huge images in you applications.

I had to debug an app that was slow, and I discovered it if the images

were bigger than 500k, the app was slowing down.

2. Do not use animated gifs.

I am not sure why, but on heavy js applications, the animated was

simply slowing down the app so much it get unusable. After i got rid

of the animated gif, the speed improved a lot.

I'll add here the tip from Reverend

3. For transition that includes opacity set in css -webkit-backface-visibility: hidden; to avoid flickering.

 

Would be nice to contribute with your tips. Thank you.

 

Update: by Brock Whitten

Tip 1: Do not use setTimeout() for animations. (yes, this means animation of 

your favorite library is out). Use css transitions instead. see 

http://www.ferretarmy.com/css-animation-examples/ for examples 

Tip 2: Use "Online" mode for development only. When you ship to the app 

store you should have your html javascript and css fils all in the www 

directory. for dynamic apps, just grab a json payload instead of keeping 

your entire app on a server. 

Tip 3: Test you animations early on the device. Don't wait until later for 

unpleasant surprises.