Profiling the Java Code

Jim Chen nchen at mozilla.com
Thu Jan 9 12:43:54 PST 2014


I added these tips to
https://wiki.mozilla.org/Mobile/Fennec/Android/Profiling


On 1/8/14 6:26 PM, Mark Finkle wrote:
> For many of the pageload performance bugs [1], we used profiles of the Java code to uncover the issues. This is just a quick post covering what you need to do in order to get profiles. 
> 
> 1. The Fennec build needs to be "debuggable" [2]. Nightlies are not, but local developer builds are. 
> 2. For profiling pageload, you can generally use Monitor/DDMS [3]. Just press the "start method tracing" button, load a page, wait, press the "stop method tracing" button. 
> 3. For profiling startup time, you really need to add Debug.startMethodTracing(...) and Debug.stopMethodTracing(). I added a simple patch [4] to show what I mean. 

I see the "am start" command has a -P option that starts profiling on
launch until the app becomes idle. e.g.,

adb shell am start -n org.mozilla.fennec_$USER/.App \
                   -S -P /data/local/tmp/fennec.trace
# wait for Fennec launch
adb pull /data/local/tmp/fennec.trace
# in Monitor, File > Open File > fennec.trace


Cheers,
Jim



More information about the mobile-firefox-dev mailing list