Performance/Fenix/Profilers and Tools: Difference between revisions

Jump to navigation Jump to search
Edited lists to be more readable.
(A quick guide to analyze performance on Fenix)
 
(Edited lists to be more readable.)
Line 13: Line 13:
There are different tools at your disposal.  Each of them has a specific use case and the details are below.
There are different tools at your disposal.  Each of them has a specific use case and the details are below.


# The '''Firefox Profiler / Gecko Profiler''' ([https://profiler.firefox.com/docs/#/./guide-remote-profiling documentation]) is the preferred profiler. This profiler allows us to profile the code with lower overhead and non-debuggable builds including APKs from the Play Store, capture native code, and share profiles right in the browser. The UX is just so much better. :) You should try another profiler if you:
<ol>
## Need access to Java threads other than the main thread (issue )
  <li>The '''Firefox Profiler / Gecko Profiler''' ([https://profiler.firefox.com/docs/#/./guide-remote-profiling documentation]) is the preferred profiler. This profiler allows us to profile the code with lower overhead and non-debuggable builds including APKs from the Play Store, capture native code, and share profiles right in the browser. The UX is just so much better. :) You should try another profiler if you:
## Are profiling application start up and some information is missing ([https://bugzilla.mozilla.org/show_bug.cgi?id=1659103 bug 1659103])
    <ol>
#The '''Android Profiler''' ([https://developer.android.com/studio/profile/android-profiler/?gclid=EAIaIQobChMImNycnqrf6gIVUfDACh3PWQe6EAAYASAAEgIb6_D_BwE&gclsrc=aw.ds documentation]) is most useful when you:  
      <li>Need access to Java threads other than the main thread (issue )</li>
##Need access to Java threads other than the main thread  
      <li>Are profiling application start up and some information is missing ([https://bugzilla.mozilla.org/show_bug.cgi?id=1659103 bug 1659103])</li>
##Are profiling application start up and want to capture it as early as possible
    </ol> 
#: The results in the Android Profiler are '''very misleading''': what you see in profiles may not accurately represent what users’ experience in release builds. This is due to the debuggable=true requirement which causes different methods to  increase in runtime inconsistently ([https://youtu.be/ZffMCJdA5Qc?t=631 further explanation]). For example, in the AS Profiler, we’ve seen that UI layout is proportionally longer than business logic than in production builds.
  </li>
  <li>The '''Android Profiler''' ([https://developer.android.com/studio/profile/android-profiler/?gclid=EAIaIQobChMImNycnqrf6gIVUfDACh3PWQe6EAAYASAAEgIb6_D_BwE&gclsrc=aw.ds documentation]) is most useful when you:  
    <ol>
        <li> Need access to Java threads other than the main thread </li>
        <li> Are profiling application start up and want to capture it as early as possible </li>
    </ol> The results in the Android Profiler are '''very misleading''': what you see in profiles may not accurately represent what users’ experience in release builds. This is due to the debuggable=true requirement which causes different methods to  increase in runtime inconsistently ([https://youtu.be/ZffMCJdA5Qc?t=631 further explanation]). For example, in the AS Profiler, we’ve seen that UI layout is proportionally longer than business logic than in production builds.
  </li>
</ol>
=== Advanced tools: ===
=== Advanced tools: ===
#'''Simpleperf''' ([https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/README.md#Android-application-profiling official documentation]; follow the Fenix-specific steps found in this [https://github.com/acreskeyMoz/simpleperf_for_geckoview_example#simpleperf-for-gecko-apps README]) is most useful when you:
 
##Need access to Java threads other than the main thread
<ol>
##Are profiling application start up and want to capture it as early as possible
  <li>'''Simpleperf''' ([https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/README.md#Android-application-profiling official documentation]; follow the Fenix-specific steps found in this [https://github.com/acreskeyMoz/simpleperf_for_geckoview_example#simpleperf-for-gecko-apps README]) is most useful when you:
#:This is a good alternative to the AS profiler since it has a much lower overhead. However, it’s difficult to set up and will only be able to profile start up with rooted phones.
    <ol>
#'''Nanoscope''' is another tool that can be useful to profile non-debuggable applications. ([https://github.com/acreskeyMoz/simpleperf_for_geckoview_example#simpleperf-for-gecko-apps documentation]). We would only suggest to use this tool whenever profiling start up has failed with the previous options.
      <li> Need access to Java threads other than the main thread</li>
      <li> Are profiling application start up and want to capture it as early as possible </li>
    </ol>This is a good alternative to the AS profiler since it has a much lower overhead. However, it’s difficult to set up and will only be able to profile start up with rooted phones.
  </li>
  <li>'''Nanoscope''' is another tool that can be useful to profile non-debuggable applications. ([https://github.com/acreskeyMoz/simpleperf_for_geckoview_example#simpleperf-for-gecko-apps documentation]). We would only suggest to use this tool whenever profiling start up has failed with the previous options.
  </li>
</ol>


== Timestamp measurement ==
== Timestamp measurement ==
8

edits

Navigation menu