jhen0409 / jhen0409/react-native-debugger

Profiler does not show huge CPU usage in a Redux reducer

Open
#617 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10.4k
Forks
815
PR merge metrics
No merged PRs in 30d

Description

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](https://user-images.githubusercontent.com/1302357/120288074-1f536300-c2c0-11eb-82f3-687aa091eb48.png)

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.