如何知道生产中是否启用了自动批处理

问题描述 投票:0回答:0

关于环境的一些信息:

SDK Version: 48
Platforms(Android/iOS/web/all): Android/iOS
react: 18.2.0, react-native: 0.71.4
Expo Workflow: managed 2.28

React 新架构和自动批处理已经可用于 react/react-native 版本(在上面 3 中提到)。但在 Expo Go(以上 4)中不可用。

我对“自动批处理”很感兴趣,因为我的组件中使用了很多 setState。 我对渲染性能的测试结果告诉我以下差异:

Expo Go - test environment (slow, and no automatic batching, render on every setState)
The app built - production environment (fast, just 30% time of that used in Expo Go)

但是我不知道上面的案例2是否启用了“自动批处理”。 或者更快的渲染是否是因为自动批处理或新架构......或者因为其他一些原因?

有人知道或有什么建议可以分享吗?

提前致谢!

reactjs react-native expo new-operator setstate
© www.soinside.com 2019 - 2024. All rights reserved.