Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Perf] Baseline CPU Usage #1539

Closed
vishnevskiy opened this issue Jun 7, 2015 · 6 comments
Closed

[Perf] Baseline CPU Usage #1539

vishnevskiy opened this issue Jun 7, 2015 · 6 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@vishnevskiy
Copy link
Contributor

It seems that any react-native app uses 4% CPU even when idle even when in Release.

https://www.dropbox.com/s/plsvxh7r15bpha9/Screenshot%202015-06-06%2020.00.45.png?dl=0

I profiled in Instruments (both my own app and UIExplorer) and it seems that jsThreadUpdate is the one responsible. Seems to be constantly looking up module names and dispatching to RCTEventDispatcher and RCTTimer (even when they have no work).

https://www.dropbox.com/s/u5mtztcltk1c884/Screenshot%202015-06-06%2020.02.27.png?dl=0

This may very well be intended? This was done on an iPhone 6 so I assume it can only be worse on lower end devices.

@ide ide changed the title Baseline CPU Usage [Perf] Baseline CPU Usage Jun 7, 2015
@ide
Copy link
Contributor

ide commented Jun 7, 2015

4% CPU usage when the app isn't doing anything is high. The run loop shouldn't do real work if there are no tasks for it.

@tadeuzagallo
Copy link
Contributor

ListView has a setInterval of 20ms used to check items that are on screen. I'm not sure it's still necessary, I'll look into it.

@tadeuzagallo tadeuzagallo self-assigned this Jun 7, 2015
@tadeuzagallo
Copy link
Contributor

Sorry, my mistake, it has already been removed recently, but we still have to go through the modules that implement RCTFrameUpdateObserver, that includes RCTTimer and RCTEventDispatcher, I'll see if we can avoid it.

@brentvatne
Copy link
Collaborator

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out it's new home: https://productpains.com/post/react-native/perf-baseline-cpu-usage

@strefethen
Copy link

Was trying to make some headway with UI automation of a hybrid RN app but it looks like this idle CPU usage prevents Apple's automation support from detecting the app is actually idle leading to: "App failed to quiesce within 30.0s". I've been looking for a means of tweaking what the automation framework needs to detect idle in terms of CPU.

@jrz
Copy link

jrz commented May 27, 2016

For me an idle app (just some views, no logic) takes 8%

@facebook facebook locked as resolved and limited conversation to collaborators Jul 22, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants