| Dustin Lam | db6ec1f | 2021-07-19 17:12:31 -0700 | [diff] [blame] | 1 | # AndroidX Collection Benchmarks for Native Platforms |
| 2 | |
| 3 | This directory builds a set of benchmarks for AndroidX Collection on native |
| 4 | platforms. Currently only macOS (x86_64) is supported. |
| 5 | |
| 6 | To build, run in the collection project root: |
| 7 | |
| Lukhnos Liu | a15f2861 | 2021-11-09 09:37:07 -0800 | [diff] [blame] | 8 | ./gradlew --no-configuration-cache -Pandroidx.github.build=true :collection:collection-benchmark-native:assemble |
| Dustin Lam | db6ec1f | 2021-07-19 17:12:31 -0700 | [diff] [blame] | 9 | |
| 10 | Then execute the resulting binary at: |
| 11 | |
| Lukhnos Liu | a15f2861 | 2021-11-09 09:37:07 -0800 | [diff] [blame] | 12 | ../../out/androidx/collection/collection-benchmark-native/build/exe/main/debug/collection-benchmark-native |
| Dustin Lam | db6ec1f | 2021-07-19 17:12:31 -0700 | [diff] [blame] | 13 | |
| 14 | The output will look something like this: |
| 15 | |
| 16 | ``` |
| Lukhnos Liu | a15f2861 | 2021-11-09 09:37:07 -0800 | [diff] [blame] | 17 | Running ../../out/collection-playground/collection-playground/collection/collection-benchmark-native/build/install/main/debug/lib/collection-benchmark-native |
| Dustin Lam | db6ec1f | 2021-07-19 17:12:31 -0700 | [diff] [blame] | 18 | Run on (12 X 2900 MHz CPU s) |
| 19 | CPU Caches: |
| 20 | L1 Data 32 KiB (x6) |
| 21 | L1 Instruction 32 KiB (x6) |
| 22 | L2 Unified 256 KiB (x6) |
| 23 | L3 Unified 12288 KiB (x1) |
| 24 | Load Average: 2.21, 2.43, 2.23 |
| 25 | -------------------------------------------------------------------------------------------------------- |
| 26 | Benchmark Time CPU Iterations |
| 27 | -------------------------------------------------------------------------------------------------------- |
| 28 | BM_CircularArray_addFromHeadAndPopFromTail_ObjCCallingKMP 4599997 ns 4590038 ns 158 |
| 29 | BM_SimpleArrayMap_addAllThenRemoveIndividually_ObjCCallingKMP 1635764920 ns 1628431000 ns 1 |
| 30 | ``` |
| 31 | |
| 32 | This project assumes you have |
| 33 | [Google Benchmark](https://github.com/google/benchmark) installed. It also |
| 34 | assumes you have installed Xcode. |