Sencha Touch 2 android performance

江枫思渺然 提交于 2019-12-31 08:38:44

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/10338020/sencha-touch-2-android-performance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!