Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
libs/ | 03-May-2024 | - | 203 | 169 | ||
src/benchmarks/ | 03-May-2024 | - | 15,925 | 12,619 | ||
src_androidx/libcore/benchmark/ | 03-May-2024 | - | 154 | 101 | ||
Android.bp | D | 03-May-2024 | 1.9 KiB | 70 | 65 | |
AndroidManifest.xml | D | 03-May-2024 | 1 KiB | 26 | 8 | |
AndroidTest.xml | D | 03-May-2024 | 1.5 KiB | 33 | 16 | |
README.md | D | 03-May-2024 | 1.6 KiB | 58 | 39 |
README.md
1 2# Run Caliper benchmark tests using vogar on a rooted device 3 4- It uses the [Caliper library](https://github.com/google/caliper) developed by Google. 5- Vogar source codes can be found at `external/vogar`. 6 71. Preparation 8 9```shell 10# vogar requires com.android.art.testing 11m vogar com.android.art.testing 12# remount if you haven't done so. 13adb root && adb remount && adb reboot && adb wait-for-device root 14cd libcore/benchmarks/src 15``` 16 17Extra options to reduce noise: 18```shell 19adb shell stop # to kill frameworks and zygote 20``` 21 222. Run an individual test 23 24```shell 25vogar --benchmark benchmarks/regression/ScannerBenchmark.java 26``` 27 28The source code of the tests can be found at `src/benchmarks/` 29 30# Run Jetpack benchmark tests 31Docs about Jetpack Benchmark can be found at 32[https://developer.android.com/studio/profile/benchmarking-overview]() 33 341. Preparation 35 36To lock CPU clocks on a rooted device, 37run the script provided at [https://developer.android.com/studio/profile/run-benchmarks-in-ci#clock-locking](). 38 392. Run an individual test 40```shell 41atest LibcoreBenchmarkTests:libcore.benchmark.FormatterTest#stringFormatNumber_allLocales 42``` 43 44The source code of the tests can be found at `src_androidx/libcore/benchmark/` 45 46## Outdated documentation / Not working 47 48###VM Options 49 50 51The VM's configuration will have a substantial impact on performance. 52Use Caliper's -J<name> <value 1>,<value 2>,<value 3> syntax to compare different VM options. For example: 53```shell 54vogar --benchmark ~/svn/dalvik/benchmarks/regression/CrespoFileIoRegressionBenchmark.java \ 55-- -Jgc -Xgc:noconcurrent,-Xgc:concurrent -Jint -Xint:fast,-Xint:jit,-Xint:portable 56``` 57 58