summaryrefslogtreecommitdiff
path: root/benchmarks/stdlib_benchmark.cpp
AgeCommit message (Collapse)Author
2020-10-22Make more use of benchmark::DoNotOptimize in benchmarks.Elliott Hughes
A lot of these benchmarks predate DoNotOptimize and rolled their own hacks. Bug: http://b/148307629 Test: ran benchmarks before & after and got similar results Change-Id: If44699d261b687f6253af709edda58f4c90fb285
2020-01-29Add a couple of new benchmarks.Christopher Ferris
Add a calloc benchmark to make sure that a native allocator isn't doing anything incorrectly when zero'ing memory. Also add a fork call benchmark to verify that the time to make a fork call isn't increasing. Test: Ran benchmarks on walleye and verified that the numbers are not Test: too variable between runs. Change-Id: I61d289d277f85ac432a315e539cf6391ea036866
2019-12-05Add mallopt M_PURGE benchmark.Christopher Ferris
Update the native allocator documentation to include running of this benchmark. Move the malloc_benchmark.cpp to malloc_sql_benchmark.cpp and use malloc_benchmark.cpp for benchmarking functions from malloc.h. Bug: 137795072 Test: Ran new benchmark. Change-Id: I76856de833032da324ad0bc0b6bd85a4ea8c253d
2019-11-13Remove unused code.Christopher Ferris
Test: Compiles. Change-Id: I92095bd0ee59a3b98ee8deba1c3efc4685389a1b
2019-09-26benchmarks: remove more boilerplate.Elliott Hughes
Many of our benchmarks are basically just "call one function with a fixed argument". We don't need to keep repeating all the boilerplate for that. This also ensures we don't forget the benchmark::DoNotOptimize, which -- in addition to being a good idea in general -- specifically solves the problem with gettid benchmark and provides a more accurate result by removing the indirection through a function pointer. Test: ran benchmarks Change-Id: Id67535243678cd0d48f51cf25141e2040da9af03
2019-04-05Add malloc benchmarks.Christopher Ferris
Adding some benchmarks that keep a certain number of allocation around. This benchmark should not be used as an absolute for determining what is a good/bad native allocator. However, it should be used to make sure that numbers are not completely changed between allocator versions. Also update the malloc sql benchmark to match the same style as these new benchmarks. Bug: 129743239 Test: Ran these benchmarks. Change-Id: I1995d98fd269b61d9c96efed6eff3ed278e24c97
2018-09-20Touch the memory when doing malloc/free benchmark.Christopher Ferris
Also, update the benchmark loop for modern C++. Test: Ran benchmarks. Change-Id: I925446b893793eb8c2c6759716cdd3dbbcf1e7c1
2018-08-02Modernize codebase by replacing NULL with nullptrYi Kong
Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I5b4123bc6709641315120a191e36cc57541349b2
2017-12-19More benchmarks.Elliott Hughes
Add a hand-rolled maps line parser as something to compare our realistic sscanf benchmark against. Also add benchmarks for the ato*/strto* family. This patch doesn't fix the tests, which seem to have been broken by the recent google-benchmark upgrade despite the benchmarks themselves all working just fine. To me that's a final strike against these tests which are hard to maintain and not obviously useful, but we can worry about what to do with them -- whether to just delete them or to try to turn them into tests that actually have some value -- in a separate CL. Bug: N/A Test: ran benchmarks Change-Id: I6c9a77ece98d624baeb049b360876ef5c35ea7f2
2017-11-30Generate all the benchmarks to run.Christopher Ferris
Instead of requiring the need to maintain a list of all the benchmarks, add a programmatic way to generate all of the benchmarks. This generation runs the benchmarks in alphabetical order. Add a new macro BIONIC_BENCHMARK_WITH_ARG that will be the default argument to pass to the benchmark. Change the benchmarks that require default arguments. Add a small example xml file, and remove the full.xml/host.xml files. Update readme. Test: Ran new unit tests, verified all tests are added. Change-Id: I8036daeae7635393222a7a92d18f34119adba745
2017-08-09Improve error handling and fix minor bugs in bionic benchmarks.Anders Lewis
Test: Unit tests. Change-Id: I224ae4c7f195176eb8a87deddb2debcbf0f24ba3
2017-08-09Add musl benchmarks.Anders Lewis
Test: Unit tests. Change-Id: Ifb2911825f84b95fe64a803bfabd32fb81210eae