blob: 98e16f7115762058e10350208a019f4d585b03c9 [file] [log] [blame] [view]
Dustin Lamdb6ec1f2021-07-19 17:12:31 -07001# AndroidX Collection Benchmarks for Native Platforms
2
3This directory builds a set of benchmarks for AndroidX Collection on native
4platforms. Currently only macOS (x86_64) is supported.
5
6To build, run in the collection project root:
7
8 ./gradlew :collection:collection-benchmark-native:assemble
9
10Then execute the resulting binary at:
11
12 ../out/collection-playground/collection-playground/collection/collection-benchmark-native/build/install/main/debug/collection-benchmark-native
13
14The output will look something like this:
15
16```
17Running ../out/collection-playground/collection-playground/collection/collection-benchmark-native/build/install/main/debug/lib/collection-benchmark-native
18Run on (12 X 2900 MHz CPU s)
19CPU 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)
24Load Average: 2.21, 2.43, 2.23
25--------------------------------------------------------------------------------------------------------
26Benchmark Time CPU Iterations
27--------------------------------------------------------------------------------------------------------
28BM_CircularArray_addFromHeadAndPopFromTail_ObjCCallingKMP 4599997 ns 4590038 ns 158
29BM_SimpleArrayMap_addAllThenRemoveIndividually_ObjCCallingKMP 1635764920 ns 1628431000 ns 1
30```
31
32This project assumes you have
33[Google Benchmark](https://github.com/google/benchmark) installed. It also
34assumes you have installed Xcode.