1

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.

RND profiling threads

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

systrace

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.

Enable Sampling Profiler

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
zbycz
  • 626
  • 9
  • 12
  • 2
    I opened an issue about systrace being broken over 6 months ago and it's being ignored. If you add your comment and thumbs up it might get some attention. https://github.com/facebook/react-native/issues/26032 – imagio Feb 20 '20 at 20:04
  • thanks, there was some communication on the issue since. Seems they know about it. I liked your comment. I dont write "me too" comments. :) – zbycz Mar 07 '20 at 20:02

1 Answers1

1

ad (1) ok - it seems you have to hit "Run profiling", and then reload the APP (rr). Only then RNDebuggerWorker.js appears. Wicked.

Worker thread -- RNDebuggerWorker

zbycz
  • 626
  • 9
  • 12