Sencha Touch 2 安卓性能 [英] Sencha Touch 2 android performance
问题描述
我听说 sencha 总的来说,仅仅因为使用 javascript,在 android 设备上存在性能问题.
I am hearing that sencha in general, by the mere fact of using javascript, has performance issues on android devices.
我熟悉 android webview 对象的局限性,但我想知道这些性能声明是否有任何优点,尤其是在 Sencha Touch 2 发布的情况下
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
虽然我没有低端 android 设备,但我浏览了 Sencha Touch 2 库,并没有很容易找到免费的 android 应用程序,所以也许您可以解释一下您在 Android 上使用 Sencha Touch 2 的体验以及您的体验这样做是为了让它更快
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
推荐答案
根据我目前的经验,在开发具有尽可能最佳性能的 Sencha Touch 2 应用程序时,有一些关键点需要牢记:
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:
优化应用程序启动时间:
To optimize application startup time:
- 压缩您的 JS &CSS 文件.删除任何未使用的 JS 函数或 CSS mixin(这可以通过 SASS/Compass 轻松完成).更多详情,请阅读:http://www.sencha.com/blog/an-introduction-to-theming-sencha-touch
- 动态加载外部JS文件,这里已经有一个很好的话题:在 Sencha Touch 2 中加载外部 javascript 的正确方法是什么
优化应用程序性能:
- 使您的 DOM 结构尽可能小.应该销毁非活动视图(如果需要,稍后动态添加到您的容器中).
- 避免使用过多的 CSS3 属性,因为它们在 Android 设备上非常慢.
- 对于任何滚动视图,应在 Android 上禁用过度滚动.我已经在 Android 设备上测试了许多 Sencha Touch 2 应用程序,由于延迟和滞后,过度滚动会导致非常不愉快的体验.(在 Galaxy Tab、Nexus S 和一些 HTC 上测试过)
这里还有一个主题与您的关注非常相关:
There's also a topic here which is quite relevant to your concern:
PhoneGap 1.4 包装Sencha Touch 2.X - 性能如何?
希望有帮助.
于 2014 年 2 月 12 日编辑:我发布这个答案已经将近 2 年了(即我使用 Sencha Touch 已经超过 3 年了),我不得不说遗憾的是,Android 上的 Sencha Touch 性能令人无法接受.有时我认为我没有完全掌握最佳实践,但我认为这不是原因.或者至少,我们需要花费数年时间才能开发出与原生应用具有相同外观和感觉"的大型 Sencha Touch 应用,因为这些技巧花费了我们太多时间.
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.
简而言之,如果您的目标是 iOS 或者您的应用程序非常小,那也没关系.但是对于 Android 上的大型应用程序,我个人不使用 Sencha Touch.
这篇关于Sencha Touch 2 安卓性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!