I would like to see, which function is keeping my JS thread the most busy. But in any profiling option I just cant see any JS related stuff.
1) Profiling
The most useful would be the V8 profiler, which is accessible in debug mode (in Chrome DevTools or React Native Debugger). Somebody here suggests to look for debuggerWorker.js
, but in my Profiling session this thread is missing.
2) Systrace
I found the JS thread (mqt_js
), but it is collapsed and cant be drilled into. Any ideas?
I run systrace.py --time=20 -o trace.html sched gfx view -a com.my.rnapp
3) RN "Enable Sampling Profiler"
I even tried the (undocumented) "Enable Sampling Profiler" option in RN debug menu, it seems working, and shows a message with trace location, but file is unfortunately empty everytime. (eg. /data/user/0/com.my.rnapp/cache/sampling-profiler-trace119834863.cpuprofile
). Checked using adb shell
and ls -la
.
Other info:
- tested both dev/prod versions, local metro bundler/bundled app
- React Native 0.61.1
- Emulator with Android API 25 (physical device as well)
- macOS 10.14