如何衡量 Ionic 3 应用程序的性能? [英] How to measure the performance of an Ionic 3 app?

查看:24
本文介绍了如何衡量 Ionic 3 应用程序的性能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Ionic 3 框架开发了一个应用程序.我想测量我的应用程序的 CPU 和内存使用情况.这样做的最佳做法是什么?

解决方案

不得使用 AndroidStudioXCode 来测量内存使用情况Ionic 应用程序.

为什么?这是来自

I have developed an app using Ionic 3 framework. I would like to measure the CPU and memory usage of my app. What is the best practice to do so?

解决方案

You must not use AndroidStudio and XCode to measure the memory usage of the Ionic app.

Why? Here is the comment from Ionic team member

Unfortunately we have not been able to reproduce this issue on our end. Would you mind checking your app on your device with safari dev tools instead of the memory tool in xcode? The reason I recommend this is because the xcode memory tools can be misleading in the fact that it's not actually measuring memory usage of the javascript heap of the app, instead, it is reading the memory used by the kernel / OS itself. So based off the same concept I described here, the OS will not free up memory used by the JS virtual machine if it 1. thinks the action that used that memory is going to happen often and 2. thinks that it has plenty of memory to spare. So, while the JS heap memory will be shrinking every time the JS engine runs garbage collection, that does not mean that the memory that iOS has allocated to the browser will shrink, and, if iOS did start freeing up memory when it has plenty of memory available you would actually see performance issues. Also, it's important to remember that high memory usage does not === a memory leak and in fact operating systems are built to take the most advantage of the resources (in this case ram) available to it, especially on mobile devices.

Tools:

Safari dev tools

Chrome dev tools

这篇关于如何衡量 Ionic 3 应用程序的性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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