简体   繁体   English

当远程调试器关闭时,Reos本机在ios设备上运行缓慢

[英]React native runs slow on ios device when remote debugger is off

I run into this issue when try to run app on ios device(ipad4,ios10). 尝试在ios设备(ipad4,ios10)上运行应用程序时遇到此问题。
The app runs slow on device when remote debugger is off, if remote js debugger is on, then it runs pretty fine. 当远程调试器关闭时,应用程序在设备上运行缓慢,如果启用了远程js调试器,那么它运行得非常好。
I also tried react-native run-ios --configuration Release , but its still slow. 我也尝试过react-native run-ios --configuration Release ,但它仍然很慢。 Don't know what's going on here. 不知道这里发生了什么。
Any idea how can I evaluate the real performance of the app ? 任何想法如何评估应用程序的真实性能?
Many thanks. 非常感谢。

Try to change the scheme in xcode: Product -> Scheme -> Edit Scheme -> Run -> Set Build configuration to Release. 尝试在xcode中更改方案:Product - > Scheme - > Edit Scheme - > Run - > Set Build configuration to Release。

在此输入图像描述

I had a similar issue and my problem was that I was doing some extra console.log calls into the render methods and it was slowing everything down because of that. 我有一个类似的问题,我的问题是我在渲染方法中做了一些额外的console.log调用,因此减慢了一切。 See if you have these in your code, remove them and try to run it again. 看看你的代码中是否有这些,删除它们并尝试再次运行它。

The problem was the same, with the debugger everything run great (I assume the logs were removed) and without debugger I saw the logs running in xCode. 问题是一样的,调试器一切运行良好(我假设日志已被删除),没有调试器我看到日志在xCode中运行。 You can check the same in the console logs that are shown in xCode when you connect a simulator or device to your machine. 将模拟器或设备连接到计算机时,可以在xCode中显示的控制台日志中检查相同内容。 In there, I was seeing a huge JSON object being logged every few seconds and then the log froze for some time. 在那里,我看到每隔几秒就会记录一个巨大的JSON对象,然后日志冻结了一段时间。

It's not a solution to your problem (I really hope for you, your problem is solved in the meantime, but I'm still posting this answer if anyone else is having this problem). 这不是你的问题的解决方案(我真的希望你,你的问题在此期间得到解决,但如果其他人有这个问题,我仍然会发布这个答案)。

As written in this github issue , when you run your app with a debugger, the JS thread lives in your debugger and not in your app. 正如在这个github问题中所写,当您使用调试器运行应用程序时,JS线程存在于调试器中而不是您的应用程序中。 This means if you're using for example the chrome debugger, your JS get executed with the google V8 VM and the speed of your Browser/Computer. 这意味着如果您使用的是chrome调试器,则可以使用google V8 VM和浏览器/计算机的速度执行JS。 Make sure to disable every debug option and switch to release mode when you do a performance test. 确保在执行性能测试时禁用每个调试选项并切换到释放模式。

If you still have performance problems you have to look and analyze other things. 如果您仍然遇到性能问题,则必须查看并分析其他内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React本机ios远程js调试器不可用 - React native ios remote js debugger unavailable React-Native:如何在真正的 iOS 设备上使用“远程 JS 调试器”? - React-Native: how to use “Remote JS Debugger” on real iOS-device? 无法在 mac for iOS 应用程序中连接 React native 中的远程调试器? - Not able to connect remote debugger in React native in mac for iOS app? React 原生调试器太慢了 - React native debugger is too slow LandScape不能在React Native中工作吗? 当IOS / Android设备关闭模式自动旋转时 - LandScape not Working in React native ? when IOS / Android Device off mode Auto Rotation 未启用远程调试器时,React Native Detox测试失败 - React Native Detox tests fail when remote debugger not enabled 在Windows中连接到远程调试器时的React-native超时 - React-native Timeout when connecting to remote debugger in windows 当我使用带有 xcode 的真实 ios 设备进行测试时,react-native-push-notification 远程不显示 - react-native-push-notification remote doesn't show when I test with real ios device with xcode react-native:远程调试器停止工作 - react-native: remote debugger stopped working React native 无法连接远程调试器 ECONNREFUSED - React native Unable to connect with remote debugger ECONNREFUSED
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM