jhen0409 / jhen0409/react-native-debugger

Profiler does not show huge CPU usage in a Redux reducer

Aperta
#617 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
10.4k
Fork
815
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo il comportamento del profiler con il progetto di esempio redux-profiling collegato, usando le versioni indicate di React Native, Expo, iOS e React Native Debugger. Confronta l’output del profiler durante il ciclo di quattro secondi del reducer; il lavoro è completato quando il lavoro del reducer che fa un uso intensivo della CPU è rappresentato nell’output del profiler.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, react-native, redux
Ambito
devtools, mobile-dev, performance
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
32/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.