| 1 | ## IMF performance tests |
| 2 | |
| 3 | These tests are adaptation of Window Manager perf tests (apct-tests/perftests/windowmanager). |
| 4 | |
| 5 | ### Precondition |
| 6 | To reduce the variance of the test, if `perf-setup` (platform_testing/scripts/perf-setup) |
| 7 | is available, it is better to use the following instructions to lock CPU and GPU frequencies. |
| 8 | ``` |
| 9 | m perf-setup |
| 10 | PERF_SETUP_PATH=/data/local/tmp/perf-setup.sh |
| 11 | adb push $OUT/$PERF_SETUP_PATH $PERF_SETUP_PATH |
| 12 | adb shell chmod +x $PERF_SETUP_PATH |
| 13 | adb shell $PERF_SETUP_PATH |
| 14 | ``` |
| 15 | |
| 16 | ### Example to run |
| 17 | Use `atest` |
| 18 | ``` |
| 19 | atest ImePerfTests:ImePerfTest -- \ |
| 20 | --module-arg ImePerfTests:instrumentation-arg:profiling-iterations:=20 |
| 21 | |
| 22 | ``` |
| 23 | Note: `instrumentation-arg:kill-bg:=true` is already defined in the AndroidText.xml |
| 24 | |
| 25 | Use `am instrument` |
| 26 | ``` |
| 27 | adb shell am instrument -w -r -e class android.inputmethod.ImePerfTest \ |
| 28 | -e listener android.inputmethod.ImePerfRunPrecondition \ |
| 29 | -e kill-bg true \ |
| 30 | com.android.perftests.inputmethod/androidx.test.runner.AndroidJUnitRunner |
| 31 | ``` |
| 32 | * `kill-bg` is optional. |
| 33 | |
| 34 | Test arguments |
| 35 | - kill-bg |
| 36 | * boolean: Kill background process before running test. |
| 37 | - profiling-iterations |
| 38 | * int: Run the extra iterations with enabling method profiling. |
| 39 | - profiling-sampling |
| 40 | * int: The interval (0=trace each method, default is 10) of sample profiling in microseconds. |