• Home
Name Date Size #Lines LOC

..--

suites/03-May-2024-181172

test_suites/03-May-2024-211202

tests/03-May-2024-2,9512,863

Android.bpD03-May-20243.1 KiB117109

README.mdD03-May-20242.9 KiB8661

atomic_benchmark.cppD03-May-20244.4 KiB15197

bionic_benchmarks.cppD03-May-202419.1 KiB604464

expf_input.cppD03-May-202442 KiB2,4172,386

get_heap_size_benchmark.cppD03-May-20242.6 KiB9966

inttypes_benchmark.cppD03-May-20241 KiB3515

logf_input.cppD03-May-202445.9 KiB2,9172,886

malloc_benchmark.cppD03-May-20244.5 KiB12967

math_benchmark.cppD03-May-202414.2 KiB567479

powf_input.cppD03-May-202471.6 KiB2,2192,188

property_benchmark.cppD03-May-20245.3 KiB196131

pthread_benchmark.cppD03-May-20245.9 KiB238177

run-on-host.shD03-May-2024946 3427

semaphore_benchmark.cppD03-May-20244.9 KiB15666

sincosf_input.cppD03-May-202471.7 KiB4,1574,126

stdio_benchmark.cppD03-May-20248.9 KiB308242

stdlib_benchmark.cppD03-May-20247.3 KiB261197

string_benchmark.cppD03-May-202410.6 KiB316235

time_benchmark.cppD03-May-20245.3 KiB190139

unistd_benchmark.cppD03-May-20241.5 KiB5731

util.cppD03-May-20242.7 KiB9256

util.hD03-May-20242.1 KiB6431

README.md

1Bionic Benchmarks
2=================
3
4Bionic benchmarks is a command line tool for measuring the runtimes of libc functions. It is built
5on top of [Google benchmarks](https://github.com/google/benchmark) with some additions to organize
6tests into suites.
7
8Running the benchmarks
9----------------------
10
11### Device benchmarks
12
13    $ mma
14    $ adb remount
15    $ adb sync
16    $ adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks
17    $ adb shell /data/benchmarktest64/bionic-benchmarks/bionic-benchmarks
18
19When operated without specifying an xml file, the default is to run all
20of the benchmarks in alphabetical order.
21
22You can use `--benchmark_filter=getpid` to just run benchmarks with "getpid"
23in their name.
24
25### Host benchmarks
26
27See the benchmarks/run-on-host.sh script. The host benchmarks can be run
28with 32 bit or 64 bit bionic, or the host glibc.
29
30## Suites
31
32Suites are stored in the `suites/` directory and can be chosen with the command line flag
33'--bionic_xml'.
34
35To choose a specific xml file, use the `--bionic_xml=FILE.XML` option. By default, this
36option searches for the xml file in the `suites/` directory. If it doesn't exist
37in that directory then the file will be found as relative to the current
38directory. If the option specifies the full path to an xml file such as
39`/data/nativetest/suites/example.xml`, it will be used as is.
40
41If no xml file is specified through the command-line option, the default is to use `suites/full.xml`.
42However, for the host bionic benchmarks (bionic-benchmarks-glibc), the default
43is to use `suites/host.xml`.
44
45### Format
46
47The format for a benchmark is:
48
49```
50<fn>
51    <name>BM_sample_benchmark</name>
52    <cpu><optional_cpu_to_lock></cpu>
53    <iterations><optional_iterations_to_run></iterations>
54    <args><space separated list of function args|shorthand></args>
55</fn>
56```
57
58xml-specified values for iterations and cpu take precedence over those specified via command line
59(via '--bionic_iterations' and '--bionic_cpu', respectively.)
60
61To make small changes in runs, you can also schedule benchmarks by passing in their name and a
62space-separated list of arguments via the 'bionic_extra' command line flag, e.g.
63'--bionic_extra="BM_string_memcpy AT_COMMON_SIZES"' or '--bionic_extra="BM_string_memcmp 32 8 8"'
64
65Note that benchmarks will run normally if extra arguments are passed in, and it will fail
66with a segfault if too few are passed in.
67
68### Shorthand
69
70For the sake of brevity, multiple runs can be scheduled in one xml element by putting one of the
71following in the args field:
72
73    NUM_PROPS
74    MATH_COMMON
75    AT_ALIGNED_<ONE|TWO>BUF
76    AT_<any power of two between 2 and 16384>_ALIGNED_<ONE|TWO>BUF
77    AT_COMMON_SIZES
78
79Definitions for these can be found in bionic_benchmarks.cpp, and example usages can be found in
80the suites directory.
81
82### Unit Tests
83
84Bionic benchmarks also has its own set of unit tests, which can be run from the binary in
85`/data/nativetest[64]/bionic-benchmarks-tests`
86