jhen0409 / react-native-debugger

The standalone app based on official debugger of React Native, and includes React Inspector / Redux DevTools
MIT License
10.37k stars 810 forks source link

Profiler does not show huge CPU usage in a Redux reducer #617

Open yolpsoftware opened 3 years ago

yolpsoftware commented 3 years ago

Please check out my example project here:

https://github.com/yolpsoftware/redux-profiling

It is a simple React Native app that uses Redux with two actions: one to increment a counter, one to decrement it.

The reducer (i.e. where the Redux state gets updated) has a while loop that runs for exactly 4 seconds. During these 4 seconds, it sends one CPU core to 100% usage.

I want to use React Native Debugger to profile this app, to see which function uses so much CPU. So I would expect the profiler to show something like

function counter: 4'001 ms

because it is the function counter that needs four seconds of CPU time to complete.

However, when I profile the app, nothing like this appears:

image

Not sure for what we need a profiler if it does not detect such a waste of CPU resources.

React Native Debugger app version: 0.11.9 React Native version: 0.63.4 (Expo SDK 41) Platform: iOS Is real device of platform: Yes Operating System: macOS

yolpsoftware commented 2 years ago

Is this project abandoned?

1mike12 commented 1 year ago

tumbleweed-gif-6