1## IMF performance tests
2
3These tests are adaptation of Window Manager perf tests (apct-tests/perftests/windowmanager).
4
5### Precondition
6To reduce the variance of the test, if `perf-setup` (platform_testing/scripts/perf-setup)
7is available, it is better to use the following instructions to lock CPU and GPU frequencies.
8```
9m perf-setup
10PERF_SETUP_PATH=/data/local/tmp/perf-setup.sh
11adb push $OUT/$PERF_SETUP_PATH $PERF_SETUP_PATH
12adb shell chmod +x $PERF_SETUP_PATH
13adb shell $PERF_SETUP_PATH
14```
15
16### Example to run
17Use `atest`
18```
19atest ImePerfTests:ImePerfTest -- \
20      --module-arg ImePerfTests:instrumentation-arg:profiling-iterations:=20
21
22```
23Note: `instrumentation-arg:kill-bg:=true` is already defined in the AndroidText.xml
24
25Use `am instrument`
26```
27adb 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
34Test 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.
41