History log of /bionic/benchmarks/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a630784fe1124ae5956da2639f1b324c15365fa7 17-Feb-2016 Elliott Hughes <enh@google.com> Switch bionic over to google-benchmark.

Also removes the old benchmarking library.

(cherry picked from commit 281e06ba69ce6f591697acf65a24651050809920)

Bug: http://b/24803663
Change-Id: Idde5aa759b03d2b3cb51e32785beaf1c46476fa3
ndroid.mk
enchmark.cpp
enchmark/Benchmark.h
ain.cpp
ath_benchmark.cpp
roperty_benchmark.cpp
thread_benchmark.cpp
emaphore_benchmark.cpp
tdio_benchmark.cpp
tring_benchmark.cpp
ime_benchmark.cpp
nistd_benchmark.cpp
tils.cpp
tils.h
939a7e01197858fdb8463bb5a8284ba501a3e882 05-Dec-2015 Elliott Hughes <enh@google.com> Track rename from base/ to android-base/.

Change-Id: I0a4592945400b1fa6892bf7c1fa8659fd711efa3
enchmark.cpp
tils.cpp
f9f4a432ee4f56b8cb24b2033d3b1068200a6d30 25-Aug-2015 Elliott Hughes <enh@google.com> Revert "Revert "Use compiler builtins for fabs.""

Don't enable the inlines when building libm itself. Otherwise clang gets
upset by seeing both an inline and a non-inline definition.

This reverts commit c5deb0f883cbdca7e5ab75f92f82c31d21367f49.

Change-Id: If7abdb351f5a5549d6a331b33af408e8fcfa9868
ath_benchmark.cpp
c5deb0f883cbdca7e5ab75f92f82c31d21367f49 24-Aug-2015 Elliott Hughes <enh@google.com> Revert "Use compiler builtins for fabs."

Use of "extern inline" breaks clang build.

This reverts commit d76f16973a9d06765fb1f482239b9559f893ffd0.

Change-Id: I995d0d38c3776f5c50b060f16770741c92a2acac
ath_benchmark.cpp
d76f16973a9d06765fb1f482239b9559f893ffd0 21-Aug-2015 Elliott Hughes <enh@google.com> Use compiler builtins for fabs.

Change-Id: Id3bf761d6dfc187f218b5215c53d76bddc83d50b
ath_benchmark.cpp
b662280aaff801ef936fbfab34dd1596acce945e 14-Aug-2015 Elliott Hughes <enh@google.com> Use __builtin_* in <math.h>.

Also remove cruft meant to support long-obsolete compilers. More
benchmarks.

Bug: http://b/23195789
Change-Id: Ief538e41e77a77e8013b2f4f359584e8df2c47d8
ath_benchmark.cpp
3fe1515e38d169c4d6570b5423f45ae5bfb46f2a 12-Aug-2015 Dan Albert <danalbert@google.com> Add missing include.

libc++ cleaned up a leaky header.

Change-Id: I5ac0f43a075257a9138a82be379c9cffe96e0ab9
ime_benchmark.cpp
5341691955e2fc2b271b722c37496d72a0e8c683 11-Aug-2015 Dan Albert <danalbert@google.com> Move up to C++14.

The default standard version is now ahead of us. Stop specifying C++11
so we get that too.

Change-Id: Ic96942cd7fd134118e29b744601b0119e49b6ac4
ndroid.mk
c217373bd69c501e5ad30d72df1893ab81c7fd66 13-May-2015 Elliott Hughes <enh@google.com> Fix unused result errors in bionic.

This lets us use _FORTIFY_SOURCE=2 on the host.

Change-Id: I69f5ff9834bfd595aae6584104bee10c4d8a5eeb
tdio_benchmark.cpp
tils.cpp
dc93db20a96e95827f4873fa04bb1e58177736df 17-Mar-2015 Yabin Cui <yabinc@google.com> Change name of rwlock benchmark.

rw_lock is not easy for me to remember, so I prefer changing it to rwlock.

Change-Id: I0784acaca0c3b46c28184a77eb29ffe696f9ea07
thread_benchmark.cpp
3e87c785434fdfed2fb00496cb391c411a426bdd 16-Mar-2015 Dan Albert <danalbert@google.com> Revert "Revert "Moving StringPrintf to libbase.""

This reverts commit d2dad2b24fb82604f9dbe7a082e630a524f1473d.
ndroid.mk
enchmark.cpp
d2dad2b24fb82604f9dbe7a082e630a524f1473d 16-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Moving StringPrintf to libbase."

libbase has been reverted

This reverts commit 7ed5fa1e4d37722a644518594bf2b0e1529c05e9.

Change-Id: I5d8ff8c38ff8c9123e6cee5dc15a101a79e94b2e
ndroid.mk
enchmark.cpp
7ed5fa1e4d37722a644518594bf2b0e1529c05e9 14-Mar-2015 Dan Albert <danalbert@google.com> Moving StringPrintf to libbase.

Change-Id: I47ef28bb294ffb7c7c065c5624417edf23503b77
ndroid.mk
enchmark.cpp
339ac378ca04678bdbf9d60dbe715fe7fe7189c3 21-Feb-2015 Christopher Ferris <cferris@google.com> Allow wildcards to match arg values.

Change-Id: I38230b500bb8f8f69af0d7c740855a401cd12898
enchmark.cpp
enchmark/Benchmark.h
ain.cpp
567bfb3779f238784be6d3fa9d384ecdc423ea39 20-Feb-2015 Greg Hackmann <ghackmann@google.com> Fix 64-bit benchmark build

The * flag to printf() wants an int instead of size_t, and these are
distinct types on 64-bit. To accomodate this, make the name column
width helpers return int.

In theory this truncates things, but in practice this only matters if
you have a benchmark with more than INT_MAX characters in its name (in
which case you have bigger problems).

Change-Id: I3338948c25a3a8d84f1ead2f5b457c05da8a01cf
Signed-off-by: Greg Hackmann <ghackmann@google.com>
enchmark.cpp
enchmark/Benchmark.h
df4942c04a63ae6e4f5c78ece9f696d6b8b74d32 18-Feb-2015 Christopher Ferris <cferris@google.com> Refactor the benchmark code.

Changes:
- Modify the benchmarks to derive from a single Benchmark object.
- Rewrite the main iteration code. This includes changing the iteration
code to use the actual total time calculated by the benchmark as a basis
for determining whether there are enough iterations instead of using
the time it takes to run the benchmark.
- Allow benchmarks to take no argument, int, or double.
- Fix the PrettyInt printer for negative integers.
- Modify the max column width name to include the whole name including
the arg part.
- Reformat property_benchmark.cpp in line with the rest of the code.
- Modify a few of the math benchmarks to take an argument instead of
separate benchmarks for the same function with different args.
- Create a vector of regex_t structs to represent the args all at
once instead of when running each benchmark.

This change is in preparation for adding new math based benchmarks.

Tested by running on a nexus flo running at max using the new code
and the old code and comparing. All of the numbers are similar, but
some of the iterations are different due to the slightly different
algorithm used.

Change-Id: I57ad1f3ff083282b9ffeb72e687cab369ce3523a
ndroid.mk
enchmark.cpp
enchmark/Benchmark.h
enchmark_main.cpp
nclude/benchmark.h
ain.cpp
ath_benchmark.cpp
roperty_benchmark.cpp
thread_benchmark.cpp
emaphore_benchmark.cpp
tdio_benchmark.cpp
tring_benchmark.cpp
ime_benchmark.cpp
nistd_benchmark.cpp
tils.cpp
tils.h
5d064464f139cc0b5fed57e3c439d441ad946fe9 10-Feb-2015 Mark Salyzyn <salyzyn@google.com> bionic: benchmarks: Add BM_semaphore_sem_post_sem_wait

This test reports the overhead of sem_post to sem_wake for a low thread count
and a high thread count.

Change-Id: Ic30dcc8a78d754979117446bf3a28b7575cabac7
emaphore_benchmark.cpp
7e50fb2a681c858ec7d85ff92e97794f41fd1f08 09-Feb-2015 Mark Salyzyn <salyzyn@google.com> bionic: benchmarks: Add BM_semaphore_sem_post

This test tries its best to report the producer side underlying futex
wake syscall overhead wthin sem_post. It does not measure the time it
takes for the wakeup to propagate to the consumer. It suffers from
clock_gettime syscall overhead, so subtract that. Lock the CPU speed
for consistent results as we may not reach >50% cpu utilization.

Change-Id: I02fa9dab2e6ac27202f0290115150bd3c8de00f2
emaphore_benchmark.cpp
941a1a191fc86893a7ef48926c788eb32ffa81da 27-Jan-2015 Christopher Ferris <cferris@google.com> Do not build host benchmark code on macs.

Macs don't have clock_gettime, and it doesn't seem worth getting this
to run on the host for mac.

Change-Id: I59d9939acc2ede1308b24a60c4242d45355d967d
ndroid.mk
14152b9f31cc13c4fbffcbdf8155f3c3ee0c33a7 25-Jan-2015 Elliott Hughes <enh@google.com> Remove obsolete BUILD_TINY_ANDROID.

Change-Id: If2fc97134340fd09ec2583b666ace2f673cbdf66
ndroid.mk
8c4994bbc1a9a01e34ea92c91eb5b2d1a27bd074 21-Jan-2015 Elliott Hughes <enh@google.com> Implement __fsetlocking.

The old __isthreaded hack was never very useful on Android because all user
code runs in a VM where there are lots of threads running. But __fsetlocking
lets a caller say "I'll worry about the locking for this FILE*", which is
useful for the normal case where you don't share a FILE* between threads
so you don't need any locking.

Bug: 17154740
Bug: 18593728
Change-Id: I2a8dddc29d3edff39a3d7d793387f2253608a68d
tdio_benchmark.cpp
1cf32f83d3284785c64d3ea66560d23eec915956 17-Jan-2015 Elliott Hughes <enh@google.com> Add a benchmark for using stdio to read a file in /proc.

Change-Id: I12517aae19e36b7c022a11e8807aece61bb0cb9c
tdio_benchmark.cpp
8bb020e8e58be2b0013f6d4ac0a24981cba38092 16-Jan-2015 Elliott Hughes <enh@google.com> Use SI prefixes throughout the benchmark output.

Also switch throughput to GiB/s. I did play with using the new code,
but having consistent units for all results seemed easier to use
anyway (and doesn't require extra code).

Change-Id: I466fd573373bd05619e6f6e6d3dedd7dae0d9362
enchmark_main.cpp
e48f533c95cba673244444ee5444dc95a5cb2fdb 16-Jan-2015 Elliott Hughes <enh@google.com> Use a vector of benchmarks and new for loop syntax.

Change-Id: Ib1f1250e7786770083ed6a478677a893b2075a93
enchmark_main.cpp
a763504f9d779391cf19b5259508c28a9e0cd331 28-Nov-2013 Colin Cross <ccross@android.com> bionic benchmarks: limit benchmark run time to 1s real time

The benchmark run loop tries to run until 1s of time has been
accumulated between StartBenchmarkTiming() and StopBenchmarkTiming().
If a majority of the time is spent stopped this can lead to
benchmarks running for very long periods of time. This can easily
happen when benchmarking something that requires initialization or
cleanup on each iteration.

Modify the loop to run for 1s of real time instead of 1s of
benchmark time. For existing benchmarks this shouldn't make much
of a difference.

Change-Id: Iaba8a13b4dfc4a5e2cd9992041c9173ea556f9cc
enchmark_main.cpp
7b9df19491ead673084902f6d79eebd8d192d5c6 15-Nov-2013 Colin Cross <ccross@android.com> bionic benchmarks: export benchmark library

Export libbenchmark for external projects to write benchmarks against.

Change-Id: I3b04a56a62ce517afc0d5e06dc8d28879ada3d30
ndroid.mk
enchmark.h
enchmark_main.cpp
nclude/benchmark.h
8cf1b305670123aed7638d984ca39bfd22388440 04-Dec-2014 Yabin Cui <yabinc@google.com> Use mmap to create the pthread_internal_t

Add name to mmaped regions.
Add pthread benchmark code.
Allocate pthread_internal_t on regular stack.

Bug: 16847284
Change-Id: Id60835163bb0d68092241f1a118015b5a8f85069
thread_benchmark.cpp
06b1b8ceac992b861cc8a4fe21a3f8d5a40bb99c 02-Dec-2014 Dmitriy Ivanov <dimitry@google.com> Extract bionic-prepare-run-on-host to inc file.

Make benchmark run-on-host depend on bionic-prepare-run-on-host.

Change-Id: I0bdbf561b2580d607a49b7c83cc273320ac55429
ndroid.mk
212e0e38248860b151b28877225629a988d95b58 02-Dec-2014 Elliott Hughes <enh@google.com> Build our benchmarks against glibc too.

Bug: 18556607
Change-Id: I455ac8b93c0835836180e549486bc52d393ee6a6
ndroid.mk
enchmark_main.cpp
thread_benchmark.cpp
ime_benchmark.cpp
nistd_benchmark.cpp
076f69d828cfa5d30360e1dd2f24acd751d4a461 01-Dec-2014 Elliott Hughes <enh@google.com> Merge "Benchmark fread/fwrite both buffered and unbuffered."
47dc7c974e71f8d6275288f8137156ce317bf53c 01-Dec-2014 Elliott Hughes <enh@google.com> Benchmark fread/fwrite both buffered and unbuffered.

Bug: 18556607
Change-Id: I53905aedcea75fe550d9c423fb701c2c9bf8e831
tdio_benchmark.cpp
f2bb57cfe34fac675691439b93421f1c210e9771 01-Dec-2014 Elliott Hughes <enh@google.com> Fix running the bionic benchmarks on the host.

Bug: 18556607
Change-Id: I4e75bfcde788b43e1926be1b0146acf09b496390
ndroid.mk
3a5aeba4bda8b0977678021deed7aebeaa63ded1 27-Sep-2014 Dan Albert <danalbert@google.com> Switch benchmarks and tests to libc++.

Change-Id: I3b9c8f8c14a1e227e67ae1977cc29b0e8fccef5d
ndroid.mk
055a59c3ed3ecd8f3cac4aa5496f3d21ab56a131 26-Sep-2014 Dan Albert <danalbert@google.com> Prevent benchmarks from being optimized away.

Change-Id: I2d27b39ecdfc50e78098314567c295a2f113f8d3
ath_benchmark.cpp
837a962bf5473eeec1668de1104800ff4a53bdd1 16-Sep-2014 Calin Juravle <calin@google.com> Add benchmarks for pthread_rw_locks

Benchmarks for the following sequences:
1) pthread_rwlock_rdlock -> pthread_rwlock_unlock
2) pthread_rwlock_wrlock -> pthread_rwlock_unlock

Change-Id: I8d87d4d8afab8637ea7ff5d23a0b3a81d6d40835
thread_benchmark.cpp
905e6d58aaf515bf237e62078f8a321920fe4c6b 25-Jul-2014 Elliott Hughes <enh@google.com> Start hiding "private/bionic_time.h".

Bug: 15765976
Change-Id: Ibd9cf07067ec8dffe9fda6c3d498d4ab90708220
ime_benchmark.cpp
625993dfbb085a3cde7492eda8ec1cdc1ee39a78 16-Jul-2014 Elliott Hughes <enh@google.com> Use VDSO for clock_gettime(2) and gettimeofday(2).

Bug: 15387103
Change-Id: Ifc3608ea65060c1dc38120b10b6e79874f182a36
ndroid.mk
ime_benchmark.cpp
53531ccebbaf103d80516ff74874482ca3ee31fc 16-Jul-2014 Christopher Ferris <cferris@google.com> Make sure not to construct illegal property names.

Change-Id: I37624e69aec51efd4291f076fb87af3f35d33025
roperty_benchmark.cpp
28417e6314768d057ab7ad7a0208f1af7597b4d6 10-Jul-2014 Brigid Smith <brigidsmith@google.com> Added a __system_property_serial benchmark.

Change-Id: Ifc2116f26acb242f4dcdb6eefe128899a9dc63bb
roperty_benchmark.cpp
a304476145810d62f76b23a188b1680287716cfd 09-Jul-2014 Brigid Smith <brigidsmith@google.com> Added __system_propery_read benchmark.

Change-Id: Ic0e9118859a013aa04841de25822a81a7fc74b3c
roperty_benchmark.cpp
7086ad6919feb2415c6027163f5c63323bcca27c 20-Jun-2014 Elliott Hughes <enh@google.com> Cache getpid.

In practice, with this implementation we never need to make a system call.
We get the main thread's tid (which is the same as our pid) back from
the set_tid_address system call we have to make during initialization.
A new pthread will have the same pid as its parent, and a fork child's
main (and only) thread will have a pid equal to its tid, which we get for
free from the kernel before clone returns.

The only time we'd actually have to make a getpid system call now is if
we take a signal during fork and the signal handler calls getpid. (That,
or we call getpid in the dynamic linker while it's still dealing with its
own relocations and hasn't even set up the main thread yet.)

Bug: 15387103
Change-Id: I6d4718ed0a5c912fc75b5f738c49a023dbed5189
nistd_benchmark.cpp
5ab51d0d1af455afb22621dc3b75079d2b274929 12-Jun-2014 Elliott Hughes <enh@google.com> Fix GCC 4.9 complaint about int/size_t mismatch.

Change-Id: Ib13857f98658dc8760cff15adb5829e8e140008a
enchmark_main.cpp
c0eed72cbfe29d7d5f7daea9d019982465c566f0 12-Jun-2014 Elliott Hughes <enh@google.com> Size the benchmark name column appropriately.

Nobody likes misaligned output.

Change-Id: Ifbfd7beec755e91e204426a96c054d4ea20d3fae
enchmark_main.cpp
b27a840f4b520bfa095db99b0a2e5205634b0003 11-Jun-2014 Elliott Hughes <enh@google.com> Add __pure2 to a few more functions, most notably gettid and pthread_self.

Change-Id: I7eee9f26f45130038af09d8285782b07f70a996f
thread_benchmark.cpp
nistd_benchmark.cpp
7634db5a0657129225869c3650a992f9cbe82fe4 10-Jun-2014 Elliott Hughes <enh@google.com> Add a couple more system call benchmarks.

Bug: 15387103
Change-Id: I13419ddf77d201fdbde4c784259c0cb0dcfb9a77
ime_benchmark.cpp
nistd_benchmark.cpp
a147a1da5c268e9d556c207be0d3da0a519b2d54 08-Jun-2014 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: libm: Fix ARM64 fenv_t and refactor ARM64 libm implementation.

This patch fixes the ARM64 ABI for libm. fenv_t is now split in 32bit status
and 32bit control. This mirrors the AArch64 FPU control and status
registers (FPCR, FPSR).

The patch also refactors the libm implementation for ARM64 into a finer
grained control over the FPU registers.

Bionic-benchmarks has been expanded with 3 more benchmarks for floating
point operations. The new libm implementation for ARM64 performs better
over all the math benchmarks available.

Change-Id: I2a7f81d6b4e55c91f8a63a4c69614fc8b1bcf2db
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
ath_benchmark.cpp
d286796fce1e6fff407b719a53eb2afbeb96c327 04-Jun-2014 Elliott Hughes <enh@google.com> Turn on -Wunused and fix the mistakes it uncovers.

Change-Id: I023d2d8b547fbc21d4124bb7510d42b06a0dc501
ndroid.mk
5d9a7ba0dc9c24ed4e4efa9cac0e796fd524b308 31-May-2014 Elliott Hughes <enh@google.com> Avoid a system call in 'gettid'.

System calls can be pretty slow. This is mako, which has one of our
lowest latencies:

iterations ns/op
BM_unistd_getpid 10000000 209
BM_unistd_gettid 200000000 8

Bug: 15297299 (kernel panic from too many gettid calls)
Bug: 15315766 (excessive gettid overhead in liblogd)
Change-Id: I49656c0fc5b5d092390264a59e4f2c0d8a8b1aeb
nistd_benchmark.cpp
7a39094465bbd01a22565fce1f1155c762f8d145 20-May-2014 Dan Albert <danalbert@google.com> Revert "Removes bionic's dependence on stlport"

This reverts commit 4d35da1df8b74c1965b2201f6089e7d7bb352def.

Change-Id: Ie9a2620441edb55dbc5949e13a4b913ea4e66797
ndroid.mk
4d35da1df8b74c1965b2201f6089e7d7bb352def 19-May-2014 Dan Albert <danalbert@google.com> Removes bionic's dependence on stlport

Only affects tests/benchmarks. Confirmed passing on arm.

Change-Id: If158e23e8cd06e7597ef6f3c9376f6799b467e62
ndroid.mk
1728b2396591853345507a063ed6075dfd251706 14-May-2014 Elliott Hughes <enh@google.com> Switch to g_ for globals.

That's what the Google style guide recommends, and we're starting
to get a mix.

Change-Id: Ib0c53a890bb5deed5c679e887541a715faea91fc
enchmark_main.cpp
3347a7966413223fd7ba4aa80d5e5003f8e3ca15 01-May-2014 Christopher Ferris <cferris@google.com> Add ability to run on host for x86/x86_64.

Change-Id: I063cb71ce0f7247cefacaa653c7b87b7b3e72025
ndroid.mk
8b1ade5c0bdb5b3186c73c3081cc3013540190d9 01-May-2014 Christopher Ferris <cferris@google.com> Modify hard-coded directory.

Use the ANDROID_DATA environment variable instead of the hard-coded
directory for these benchmarks.

Change-Id: I00bae7b4a24e81e77fc8f52e1fe99f4d4918f520
roperty_benchmark.cpp
345b49a7c07fde18e9397ffba9079ff81a4c3d74 22-Apr-2014 Christopher Ferris <cferris@google.com> Build 32/64 bit versions of tests/benchmarks.

Change-Id: I4d146377aac6573a214dfaa5cab5cce8b10538b4
ndroid.mk
02c78a386739a8a2b3007efeb00a9ca04132100a 12-Apr-2014 Elliott Hughes <enh@google.com> Reimplement isinf/isnan/fpclassify.

Also move isinf and isnan into libc like everyone else.

Also move fpclassify to libc like the BSDs (but unlike glibc). We need
this to be able to upgrade our float/double/long double parsing to gdtoa.

Also add some missing aliases. We now have all of:

isnan, __isnan, isnanf, __isnanf, isnanl, __isnanl,
isinf, __isinf, isinff, __isinff, isinfl, __isinfl,
__fpclassify, __fpclassifyd, __fpclassifyf, __fpclassifyl.

Bug: 13469877
Change-Id: I407ffbac06c765a6c5fffda8106c37d7db04f27d
ath_benchmark.cpp
b28e490b7350b21c5ae9e5b3bb3e082d8357a1b0 11-Mar-2014 Elliott Hughes <enh@google.com> Add various benchmarks.

These are based on ones from system/extras/tests/bionic/.

Change-Id: I7b1ae15a2ca5d1031a6a511d97b88125c1770047
ndroid.mk
thread_benchmark.cpp
emaphore_benchmark.cpp
tdio_benchmark.cpp
nistd_benchmark.cpp
282e232e2a32cca8a288e81edddfd95f450cfc79 22-Oct-2013 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: Add fixes to bionic/tests

This patch adds minor fixes to the bionic unit tests.

Change-Id: Ie10f33c631ed6c10987923d678711d22931ddb05
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
ndroid.mk
enchmark_main.cpp
bd3efbc9b585e0c9801b0b35f282347cb8692ca8 16-Nov-2013 Colin Cross <ccross@android.com> bionic: move benchmarks out of tests directory

Change-Id: I4d054965198af22c9a9c821d1bc53f4e9ea01248
ndroid.mk
enchmark.h
enchmark_main.cpp
ath_benchmark.cpp
roperty_benchmark.cpp
tring_benchmark.cpp
ime_benchmark.cpp