History log of /bionic/benchmarks/benchmark/Benchmark.h
Revision Date Author Comments
339ac378ca04678bdbf9d60dbe715fe7fe7189c3 21-Feb-2015 Christopher Ferris <cferris@google.com> Allow wildcards to match arg values.

Change-Id: I38230b500bb8f8f69af0d7c740855a401cd12898
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>
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