Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

react-native

I run into this issue when try to run app on ios device(ipad4,ios10).
The app runs slow on device when remote debugger is off, if remote js debugger is on, then it runs pretty fine.
I also tried react-native run-ios --configuration Release, but its still slow. Don't know what's going on here.
Any idea how can I evaluate the real performance of the app ?
Many thanks.

like image 499
daniel Avatar asked Dec 11 '22 12:12

daniel


2 Answers

Try to change the scheme in xcode: Product -> Scheme -> Edit Scheme -> Run -> Set Build configuration to Release.

enter image description here

like image 92
MattYao Avatar answered Jan 29 '23 07:01

MattYao


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. 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. You can check the same in the console logs that are shown in xCode when you connect a simulator or device to your machine. In there, I was seeing a huge JSON object being logged every few seconds and then the log froze for some time.

like image 41
sebastianf182 Avatar answered Jan 29 '23 07:01

sebastianf182