Performance/Fenix/Performance reviews: Difference between revisions

Jump to navigation Jump to search
Fixed nits and removed Before testing section to make it more concise and clear
(Added list on how to performance test Fenix to be more concise on what to do.)
(Fixed nits and removed Before testing section to make it more concise and clear)
Line 1: Line 1:
Whenever submitting a PR for Fenix or Focus and you believe that the changed code could have a positive (or negative) impact on performance, there are a few things you can do to test the impact of the modified code. Before testing, the ideal situation to test is as follow.
Whenever submitting a PR for Fenix or Focus and you believe that the changed code could have a positive (or negative) impact on performance, there are a few things you can do to test the impact of the modified code.  
 
# Use the current reference low-end device. As of September 2021, the reference phone is (ideally) a Motorolla G5 or anything close to that.
# Ensure your network connection is good if your code depends on network requests. However, in the case that  you need to test on a throttled connection, there are ways to emulate that.
# Make sure your phone battery is not too low and that the battery saver mode is not on (if your phone allows for it).
# Ensure your phone is not too hot. A heated phone could lead to the CPU being throttled to allow the phone to cool.
 
'''Before testing, clone ([https://github.com/mozilla-mobile/perf-tools/ this repo from mozilla-mobile containing the scripts to test])'''


== Testing Start Up code ==
== Testing Start Up code ==
Line 20: Line 13:
#After determining the path your changes affect, these are the steps that you should follow:
#After determining the path your changes affect, these are the steps that you should follow:


Example:
* Run <code>measure_start_up.py</code> located in perf-tools. '''Note''':  
* Run <code>measure_start_up.py</code> located in perf-tools. '''Note''':  
**The usual iteration coumbered list itemnts used is 25. Running less iterations might affect the results due to noise
**The usual iteration coumbered list itemnts used is 25. Running less iterations might affect the results due to noise
**Make sure the application you're testing is a fresh install. ''' If testing the Main intent (which is where the browser ends up on its homepage), make sure to clear the onboarding process before testing '''  
**Make sure the application you're testing is a fresh install. ''' If testing the Main intent (which is where the browser ends up on its homepage), make sure to clear the onboarding process before testing '''  
   python3 measure_start_up.py {path_changes_affect} {path_to_repo} {release_channel} -p fenix -c {how_many_iterations_to_test} --no_start_up_cache
   python3 measure_start_up.py cold_view_nav_start /Users/johndoe/repositories/fenix/ nightly -p fenix -c 50 --no_start_up_cache
 
where <code>p</code> is the product, <code>c</code> is the iteration count


* Once you have gathered your results, you can analyze them using <code>analyze_durations.py</code> in perf-tools.  
* Once you have gathered your results, you can analyze them using <code>analyze_durations.py</code> in perf-tools.  
   python3 analyze_durations.py {path_to_output_of_measure_start_up.py}
   python3 analyze_durations.py /Users/johndoe/output/measure_start_up_results.txt




8

edits

Navigation menu