react-native 分析不显示 JS 线程 [英] react-native profiling doesn't show JS thread

查看:45
本文介绍了react-native 分析不显示 JS 线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照官方指南来分析我的 JS:

知道发生了什么吗?界面非常缓慢,占用了 100% 的 CPU,但我不知道为什么.

看起来使用最新的 react-native 版本可以解决这个问题,我使用的是 0.30.0 并且看起来在 0.34.0 周围引入了一些相关的更改>

解决方案

您可以在调试时通过 debuggerWorker.js 简单地使用 chrome 分析器:

调试时分析不会给你最准确的结果,所以要小心.

I followed the official guide to profile my JS: https://facebook.github.io/react-native/docs/android-ui-performance.html

But when I get the results, there's no js-related code I can look at:

Any idea what happened ? The interface is pretty sluggish, cusuming 100% of a CPU, but I get no infos why.

EDIT: looks like using the latest react-native version could solve that, I'm using 0.30.0 and looks like some related changes were introduced around 0.34.0

解决方案

You can simply use the chrome profiler over debuggerWorker.js while debugging:

Profiling while debugging won't give you the most accurate results so be careful.

这篇关于react-native 分析不显示 JS 线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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