Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sencha Touch 2 android performance

I am hearing that sencha in general, by the mere fact of using javascript, has performance issues on android devices.

I am familiar with limitations of the android webview object, but I was wondering if these performance claims have any merit, especially with Sencha Touch 2 being out

Although I don't have a lower end android device, I was looking through the Sencha Touch 2 gallery and could not find free android apps very easily, so perhaps you can explain your experience with Sencha Touch 2 on Android and what you did to make it faster

like image 966
CQM Avatar asked Apr 26 '12 17:04

CQM


1 Answers

To my experience so far, there are some crucial points to keep in mind when developing Sencha Touch 2 applications with as best performance as possible:

  1. To optimize application startup time:

    • Compress your JS & CSS files. Remove any unused JS functions or CSS mixins (this can be easily done through SASS/Compass). For more details, please read this: http://www.sencha.com/blog/an-introduction-to-theming-sencha-touch
    • Load external JS files dynamically, there's already a good topic here: What is the proper way to load an external javascript in Sencha Touch 2
  2. To optimize application performance:

    • Keep your DOM structure as small as possible. Inactive views should be destroyed (and dynamically added to your Container later if needed).
    • Avoid using too many CSS3 properties since they are very slow on Android devices.
    • For any scrollviews, overscroll should be disabled on Android. I've tested many Sencha Touch 2 applications on Android devices and overscroll causes badly unpleasant experience because of delays and lags. (tested on Galaxy Tab, Nexus S, and some HTCs)

There's also a topic here which is quite relevant to your concern:

PhoneGap 1.4 wrapping Sencha Touch 2.X - What about performance?

Hope it helps.

edited on Feb, 12th 2014: It has been nearly 2 years since I posted this answer (i.e. more than 3 years I have been working with Sencha Touch) and I have to say that Sencha Touch performance on Android is sadly unacceptable. Sometimes I was stuck in the thought that I'm not fully mastering the best practices, but I think it's not the reason. Or at least, it will took us years to develop a large-scale Sencha Touch app which has equal "look and feel" as native apps because the tricks take us so much time.

So in shorts, if you are targetting iOS or your app is very tiny, it's okay. But for big apps on Android, I personally don't go with Sencha Touch.

like image 157
Thiem Nguyen Avatar answered Nov 12 '22 08:11

Thiem Nguyen