Measure performance of React Native apps

一世执手 提交于 2021-02-07 08:26:39

问题


I need to measure the performance of a React Native app. What's the best tool for this?

I try google trace in google chrome, and Instruments in mac for iOS platform, but these show me a lot of unorganized data.


回答1:


I implemented some tools that helped me to check my application's performance, below is the list of the tools:

1) (reactotron) https://github.com/infinitered/reactotron

It's the coolest way to get logs of your application(redux actions etc), I have integrated this tool in my projects, in case you need any help just feel free to ask.

2) https://facebook.github.io/react/docs/perf.html (react-addons-perf)

This tool tells you about the frames/s,instances etc.. This is a react tool, it possible to integrate with react native.

Use the built-in Profiler to get detailed information about work done in the JavaScript thread and main thread side-by-side.

For iOS, Instruments are an invaluable tool, and on Android you should learn to use systrace.

You can also use react-addons-perf to get insights into where React is spending time when rendering your components.

Another way to profile JavaScript is to use the Chrome profiler while debugging. This won't give you accurate results as the code is running in Chrome but will give you a general idea of where bottlenecks might be.

Note: The above tools are for monitoring javascript performance, for example time took to rendering of components, which action in redux is getting inbetween the flow of regular actions..

Cheers :)



来源:https://stackoverflow.com/questions/43701755/measure-performance-of-react-native-apps

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