Flipper: Discussion: Flipper painfully slow on Mac Big Sur

Created on 9 Apr 2021  路  17Comments  路  Source: facebook/flipper

After the release of the 80+ version, Flipper now very slow and consumes a lot of CPU time. UI is very laggy. Sometimes all animation effect has dropped frames.

Do you know about this problem?

https://user-images.githubusercontent.com/732085/114184215-40957400-994d-11eb-868a-40fa8935047d.mp4

CleanShot 2021-04-09 at 15 36 <a href="04@2x">04@2x</a>
CleanShot 2021-04-09 at 15 41 <a href="39@2x">39@2x</a>

bug

Most helpful comment

You need to install idb

brew tap facebook/fb
brew install idb-companion
pip3 install fb-idb

Source: https://github.com/facebook/idb

When IDB is installed, launch Flipper and click on File -> Preferences

Toggle on iOS Developer and Enable Physical iOS devices

And you can set your IDB Path in IDB binary location.

In my case Idb path is /Library/Frameworks/Python.framework/Versions/3.9/bin/idb

And if you don't know the path you can execute that cmd which idb

Hope my instructions will help you :)

All 17 comments

I have the same problem
Flipper 0.84.0:

image

Same problem. So laggy! (version 0.84.0)

Hi folks, I tried reproducing this with the OSS build on several devices, but failed to get similar bad performance. Please provide some more details: what kind of device (OS + simulator / emulator) are you connected to, what plugins are enabled, and which one is currently active. Which OS are you on etc.

Providing a performance profile would be very helpful, it can be created by using View > Toggle Developer Tools > Performance Tab, and then press the record button, after it started record 10 to 20 seconds, stop the recording and use the save profile button to export it.

Hi folks, I tried reproducing this with the OSS build on several devices, but failed to get similar bad performance. Please provide some more details: what kind of device (OS + simulator / emulator) are you connected to, what plugins are enabled, and which one is currently active. Which OS are you on etc.

Providing a performance profile would be very helpful, it can be created by using View > Toggle Developer Tools > Performance Tab, and then press the record button, after it started record 10 to 20 seconds, stop the recording and use the save profile button to export it.

I'm connecting to iPhone 11 (iOS 14.4) Simulator with MacBook Pro (Mac OS 11.2.3). Profiler JSON: https://gist.github.com/rufat/cf4ce078b07ec9fe7c7218d3b5aa9245

image

It looks that the interaction with the XCode is really really slow. Could you run the following command just to verify XCode itself is responsive?

time xcode-select -p

From what I can see however, this seems to be mostly caused by Electron on Big Sur, every time we spawn a process it blocks for 300(!) ms seconds inside the standard library. It probably relates to: https://github.com/electron/electron/issues/26143 / https://github.com/libuv/libuv/issues/3050#issuecomment-778495429
Screenshot 2021-04-12 at 12 46 49

Phew, that's horrible. We don't have "official support" for Big Sur yet, as in we don't run it on Big Sur internally and have no way of testing it. If it comes down to individual command invocations, we could probably cache them more. For Xcode mismatches, that's likely something running once per session would suffice.

This specific example we could probably cache. But many commands we can't. For example querying devices happens every few seconds, we could cache 2/3 of the commands, which would make things slightly better, but that third command has to run fresh and will block the interface 400ms which will be still very noticable every few secs.

And we have many more things that spawn processes regularly: doctor checks, starting / stopping listening to logs, certificate exchange, port forwarding, etc etc. In the attached profile Flipper is blocked for 12 full seconds when starting, due to all the commands we spawn that all get penalised 馃槄.

I'll try to put up a diff next week (unless someone else volunteers) to at least cache some of the xcode commands, but I don't think it is gonna solve the problem.

From what I can see it should have been fixed in Electron 12.0.0, but later the change was reverted. It is unclear to me whether the reverted change has been released as well and in what version. It'd be awesome if someone on Big Sur could clone the repo, run it from source (yarn install && yarn start in desktop folder) and check if the issue still occurs. If it does, I'm very curious if downgrading Electron to 12.0.0 (or even before) avoids the problem. Help would be much appreciated!

It looks that the interaction with the XCode is really really slow. Could you run the following command just to verify XCode itself is responsive?

time xcode-select -p

From what I can see however, this seems to be mostly caused by Electron on Big Sur, every time we spawn a process it blocks for 300(!) ms seconds inside the standard library. It probably relates to: electron/electron#26143 / libuv/libuv#3050 (comment)
Screenshot 2021-04-12 at 12 46 49

Output is: xcode-select -p 0.00s user 0.00s system 66% cpu 0.010 total

I did try the codesign --remove-signature /Applications/Flipper.app/Contents/Frameworks/Flipper\ Helper\ \(Renderer\).app and no luck.

The interesting part is it was working smoothly with the previous versions.

I downgraded to 0.79.0 and it works smoothly again. I will use it temporarily.

Looks like the Electron 12 update shipped in 0.82. Using 0.81 should be the highest one on Electron 11

@nikoant Thanks a lot for the quick fix. Now it works much better, but not ideal 馃槄

Thanks, everyone. It works flawlessly.

@vomchik Check in Flipper settings if you correctly set 'Idb' path. After fixing that point, Flipper runs well on my computer !

@vomchik how or what do you have to do to "correctly set ldb path"?

You need to install idb

brew tap facebook/fb
brew install idb-companion
pip3 install fb-idb

Source: https://github.com/facebook/idb

When IDB is installed, launch Flipper and click on File -> Preferences

Toggle on iOS Developer and Enable Physical iOS devices

And you can set your IDB Path in IDB binary location.

In my case Idb path is /Library/Frameworks/Python.framework/Versions/3.9/bin/idb

And if you don't know the path you can execute that cmd which idb

Hope my instructions will help you :)

@vomchik Check in Flipper settings if you correctly set 'Idb' path. After fixing that point, Flipper runs well on my computer !

Thanks @vomchik that did the trick. Had the same issue on the latest version (0.90.2 (50.0.0)). Seems there is an issue when the idb location is not set.

@tkserver

You need to install idb

brew tap facebook/fb
brew install idb-companion
pip3 install fb-idb

Source: https://github.com/facebook/idb

When IDB is installed, launch Flipper and click on File -> Preferences

Toggle on iOS Developer and Enable Physical iOS devices

And you can set your IDB Path in IDB binary location.

In my case Idb path is /Library/Frameworks/Python.framework/Versions/3.9/bin/idb

And if you don't know the path you can execute that cmd which idb

Hope my instructions will help you :)

I'm using Flipper 0.91.2 but the above solution didn't work for me.

Few different points were:

  • My IDB's location is at /usr/local/bin/idb
  • Had to install fb-idb with sudo since it kept complaining that command not found. Found the solution here.
  • Not sure if this problem is related to this issue, but I see the same error when I run the command, idb list-targets

Despite those different points, the setup doctor says IDB is correctly installed but still, my mac gets slower and hotter as I open the Flipper longer so I have to close it after I'm done with debugging. Anyone faced same issue as mine?

Was this page helpful?
0 / 5 - 0 ratings