React Native“跌至今"性能监视器计数不断增加 [英] React Native "dropped so far" perf monitor count constantly increases

查看:97
本文介绍了React Native“跌至今"性能监视器计数不断增加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最初在我完成的应用程序中注意到了这个问题,但已经安装了默认的 react-native 应用程序进行测试,我看到性能监视器中的到目前为止下降"数字不断增加,即使没有发生任何事情.

I originally noticed this issue in my completed app, but have installed the default react-native app to test, and I'm seeing the "dropped so far" number in the perf monitor constantly creep up even though nothing is happening.

这个数字应该不断增加吗?

Is this number supposed to increase constantly?

推荐答案

因此基于 Michael Cheng 的回答,我深入研究了 RN 代码,并挖掘出了 EXPECTED_FRAME_TIME 设置为 16.9,a-la 经典的 60fps 幻数.

So based on Michael Cheng's answer I delved into the RN code a bit more, and dug out EXPECTED_FRAME_TIME which is set to 16.9, a-la the classic 60fps magic number.

丢帧计数器不断(即持续)增加的原因是 RN 希望以 60fps 运行,并认为任何低于此的帧率都意味着丢帧.

The reason the dropped frames counter was constantly (i.e continually) increasing was that RN expects to run at 60fps and thinks any framerate less than this means dropped frames.

然而,在使用各种帧率"测试应用程序测试了这款特定的平板电脑后,平板电脑的原生帧率似乎为 51.9fps.我不知道为什么会这样,这似乎是一个特别随意的数字,但在我所有的测试中,帧率从未超过 52,而且大多徘徊在 51.

however, having tested this particular tablet with various "framerate" testing apps, the tablet's native framerate appears to be 51.9fps. I don't know why that is, it seems a particularly arbitrary number, but in all my testing the framerate never went above 52 and mostly hovered at 51.

所以回答我的问题,到目前为止下降"是指有多少帧低于60fps,是否应该继续增加?";是的,如果设备只能以低于 60fps 的速度绘制.

So to answer my question, "dropped so far" means how many frames have been less than 60fps, and "should it increase continually?"; yes if the device is only capable of drawing less than 60fps anyway.

这篇关于React Native“跌至今"性能监视器计数不断增加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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