summaryrefslogtreecommitdiff
path: root/benchmarks/string_benchmark.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2017-11-30 08:53:15 -0800
committerChristopher Ferris <cferris@google.com>2017-11-30 09:09:41 -0800
commit858e33698d947a686fa59ed0206ce7c6656d3439 (patch)
tree74da61c257264c74bb683c5a7d7e0d387b53ac50 /benchmarks/string_benchmark.cpp
parent27d4977f1f4d0b4cbd67bd0cfc29d4d8cfff96f1 (diff)
Generate all the benchmarks to run.
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
Diffstat (limited to 'benchmarks/string_benchmark.cpp')
-rw-r--r--benchmarks/string_benchmark.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/benchmarks/string_benchmark.cpp b/benchmarks/string_benchmark.cpp
index eb04c9396..963592934 100644
--- a/benchmarks/string_benchmark.cpp
+++ b/benchmarks/string_benchmark.cpp
@@ -38,7 +38,7 @@ static void BM_string_memcmp(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_memcmp);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_memcmp, "AT_ALIGNED_TWOBUF");
static void BM_string_memcpy(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -56,7 +56,7 @@ static void BM_string_memcpy(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_memcpy);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_memcpy, "AT_ALIGNED_TWOBUF");
static void BM_string_memmove_non_overlapping(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -74,7 +74,7 @@ static void BM_string_memmove_non_overlapping(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_memmove_non_overlapping);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_memmove_non_overlapping, "AT_ALIGNED_TWOBUF");
static void BM_string_memmove_overlap_dst_before_src(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -89,7 +89,7 @@ static void BM_string_memmove_overlap_dst_before_src(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_memmove_overlap_dst_before_src);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_memmove_overlap_dst_before_src, "AT_ALIGNED_ONEBUF");
static void BM_string_memmove_overlap_src_before_dst(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -104,7 +104,7 @@ static void BM_string_memmove_overlap_src_before_dst(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_memmove_overlap_src_before_dst);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_memmove_overlap_src_before_dst, "AT_ALIGNED_ONEBUF");
static void BM_string_memset(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -119,7 +119,7 @@ static void BM_string_memset(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_memset);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_memset, "AT_ALIGNED_ONEBUF");
static void BM_string_strlen(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -136,7 +136,7 @@ static void BM_string_strlen(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_strlen);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_strlen, "AT_ALIGNED_ONEBUF");
static void BM_string_strcat_copy_only(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -159,7 +159,7 @@ static void BM_string_strcat_copy_only(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_strcat_copy_only);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_strcat_copy_only, "AT_ALIGNED_TWOBUF");
static void BM_string_strcat_seek_only(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -180,7 +180,7 @@ static void BM_string_strcat_seek_only(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_strcat_seek_only);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_strcat_seek_only, "AT_ALIGNED_TWOBUF");
static void BM_string_strcat_half_copy_half_seek(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -201,7 +201,7 @@ static void BM_string_strcat_half_copy_half_seek(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_strcat_half_copy_half_seek);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_strcat_half_copy_half_seek, "AT_ALIGNED_TWOBUF");
static void BM_string_strcpy(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -220,7 +220,7 @@ static void BM_string_strcpy(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_strcpy);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_strcpy, "AT_ALIGNED_TWOBUF");
static void BM_string_strcmp(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -241,7 +241,7 @@ static void BM_string_strcmp(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_strcmp);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_strcmp, "AT_ALIGNED_TWOBUF");
static void BM_string_strstr(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -270,7 +270,7 @@ static void BM_string_strstr(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_strstr);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_strstr, "AT_ALIGNED_TWOBUF");
static void BM_string_strchr(benchmark::State& state) {
const size_t nbytes = state.range(0);
@@ -288,4 +288,4 @@ static void BM_string_strchr(benchmark::State& state) {
state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
}
-BIONIC_BENCHMARK(BM_string_strchr);
+BIONIC_BENCHMARK_WITH_ARG(BM_string_strchr, "AT_ALIGNED_ONEBUF");