diff options
author | 2018-09-11 18:18:58 +0000 | |
---|---|---|
committer | 2018-09-11 18:18:58 +0000 | |
commit | 820e1f31efc1d6ed04795ba2e79f3044e1907492 (patch) | |
tree | 815cebb3734784074b661935c33f00bd5eb4d862 /lib/libcxx/benchmarks/vector_operations.bench.cpp | |
parent | Nuke unused LIST() ieee80211com_head. (diff) | |
download | wireguard-openbsd-820e1f31efc1d6ed04795ba2e79f3044e1907492.tar.xz wireguard-openbsd-820e1f31efc1d6ed04795ba2e79f3044e1907492.zip |
import of libc++ 6.0.0
Diffstat (limited to 'lib/libcxx/benchmarks/vector_operations.bench.cpp')
-rw-r--r-- | lib/libcxx/benchmarks/vector_operations.bench.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/libcxx/benchmarks/vector_operations.bench.cpp b/lib/libcxx/benchmarks/vector_operations.bench.cpp new file mode 100644 index 00000000000..004e801f0be --- /dev/null +++ b/lib/libcxx/benchmarks/vector_operations.bench.cpp @@ -0,0 +1,32 @@ +#include <vector> +#include <functional> +#include <cstdint> +#include <cstdlib> +#include <cstring> + +#include "benchmark/benchmark_api.h" + +#include "ContainerBenchmarks.hpp" +#include "GenerateInput.hpp" + +using namespace ContainerBenchmarks; + +constexpr std::size_t TestNumInputs = 1024; + +BENCHMARK_CAPTURE(BM_ConstructIterIter, + vector_char, + std::vector<char>{}, + getRandomIntegerInputs<char>)->Arg(TestNumInputs); + +BENCHMARK_CAPTURE(BM_ConstructIterIter, + vector_size_t, + std::vector<size_t>{}, + getRandomIntegerInputs<size_t>)->Arg(TestNumInputs); + +BENCHMARK_CAPTURE(BM_ConstructIterIter, + vector_string, + std::vector<std::string>{}, + getRandomStringInputs)->Arg(TestNumInputs); + + +BENCHMARK_MAIN() |