离子框架移动应用性能问题 [英] IONIC framework Mobile Application Performance Issue

查看:158
本文介绍了离子框架移动应用性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个高调的移动应用程序使用的离子框架我们的客户之一。 我们几乎与显影此阶段完成。该应用程序似乎运作良好时, 开放网络/手机浏览器。但是,我们这个港口到移动应用程序中使用框架命令时 该应用程序变得非常慢,卡住了不少。这是在一个非常差的用户体验。

We are developing a high profile mobile application for one of our clients using the IONIC framework. We are almost done with the development for this phase. The application seems to be working well when opening in Web/Mobile Browser. However, when we port this into a mobile application using the framework commands the application becomes very slow and gets stuck a lot. This is resulting in a very poor user experience.

我使用的命令离子运行Android创建APK。 能否请你帮我们这个问题?我们无法提交APK对于这一问题的测试。 有,我可以用它来加快应用程序的任何配置。

I am using the command "ionic run android" to create the APK. Could you please help us with this issue? We are not able to submit the APK for testing with this issue. Is there any configuration that i could use to speed up the application.

另外,我还添加了一个离子装载机在我的大部分pages.The行为很不一致(它显示有时只)。 这也有助于较差的用户体验。

Also, I have added a Ionic Loader in most of my pages.The behaviour is very inconsistent (it appears sometimes only). This is also contributing to a poor user experience.

推荐答案

离子装载机您使用的是哪一个?我是不满意的可用的解决方案,并最终轧制我自己的解决方案。

Which Ionic Loader are you using? I was unhappy with the available solutions and ended up rolling my own solution.

您针对哪个版本,什么版本的,你用的测试(物理设备)?

What version are you targeting, and what version are you testing with (physical device)?

下面是一些性能提示:

  1. 如果靶向LT; 4.4 APK大小不是一个问题,那么尝试捆绑人行横道运行。这是与离子CLI相当容易,你可以做离子浏览器插件人行横道将其列入。性能会更好,但APK尺寸会更大。

  1. If targeting < 4.4 and APK size is not an issue then try bundling the crosswalk runtime. It's fairly easy with the ionic cli, you can just do ionic browser add crosswalk to include it. Performance will be better, but APK size will be larger.

离子运行Android 将作出APK,但它是更好的做离子构建Android

ionic run android will make an APK, but it is much better to do ionic build android

缩小JS和CSS,CONCAT,并在带调试 gulpfile.js 。我也有使用html2js对模板轻微的性能提升。

Minify JS and CSS, concat, and strip debug in your gulpfile.js. I've also had slight performance gains using html2js on the templates.

当心 NG-重复。而使用集合重复或者,如果你必须使用 NG-重复,然后确保你使用的是按部就班地进行功能。

Watch out for ng-repeat. Rather use collection-repeat or, if you must use ng-repeat, then make sure you're using the track by feature.

过滤器可能会对性能产生负面影响。使用指令在可能的情况。

Filters can have a negative impact on performance. Use directives where possible.

推迟推迟推迟! $ Q 是你的朋友,可以帮助给速度的错觉。

Defer defer defer! $q is your friend and can help give an illusion of speed.

只要使用纯醇'DOM的时候可以,不是一切需要有棱有角。

Just use plain ol' DOM when you can, not everything needs to be Angular.

使用一次性绑定在可能的情况。 {{::事情}} 设定值一次,持续​​的,这意味着更少的观察家,这意味着更好的性能。

Use one-time binding where possible. {{ ::thing }} sets the value once and persists it, which means less watchers, which means better performance.

不要 $范围。$适用(),因为这将处理所有的事情。使用 $范围。$摘要()来代替,而它只会从它是从所谓的范围内进行处理。

Avoid $scope.$apply() as this processes all the things. Use $scope.$digest() instead and it will only be processed from the scope it is called from.

请您 $$观察家降到最低!

只有捆绑你所需要的。确保你包括最低限度,在图书馆等方面。

Only bundle what you need. Make sure you're including the bare minimum in terms of libraries etc.

不要使用jQuery(尽管这是显而易见的)

Don't use jQuery (although this is obvious)

祝你好运!

这篇关于离子框架移动应用性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆