Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / benchmarks / vector_operations.bench.cpp
blob38b14c56756fba0f3fe516ef1abe2dc16a75de64
1 #include <cstdint>
2 #include <cstdlib>
3 #include <cstring>
4 #include <functional>
5 #include <vector>
7 #include "benchmark/benchmark.h"
9 #include "ContainerBenchmarks.h"
10 #include "GenerateInput.h"
12 using namespace ContainerBenchmarks;
14 constexpr std::size_t TestNumInputs = 1024;
16 BENCHMARK_CAPTURE(BM_ConstructSize, vector_byte, std::vector<unsigned char>{})->Arg(5140480);
18 BENCHMARK_CAPTURE(BM_CopyConstruct, vector_int, std::vector<int>{})->Arg(5140480);
20 BENCHMARK_CAPTURE(BM_Assignment, vector_int, std::vector<int>{})->Arg(5140480);
22 BENCHMARK_CAPTURE(BM_ConstructSizeValue, vector_byte, std::vector<unsigned char>{}, 0)->Arg(5140480);
24 BENCHMARK_CAPTURE(BM_ConstructIterIter, vector_char, std::vector<char>{}, getRandomIntegerInputs<char>)
25 ->Arg(TestNumInputs);
27 BENCHMARK_CAPTURE(BM_ConstructIterIter, vector_size_t, std::vector<size_t>{}, getRandomIntegerInputs<size_t>)
28 ->Arg(TestNumInputs);
30 BENCHMARK_CAPTURE(BM_ConstructIterIter, vector_string, std::vector<std::string>{}, getRandomStringInputs)
31 ->Arg(TestNumInputs);
33 BENCHMARK_CAPTURE(BM_ConstructFromRange, vector_char, std::vector<char>{}, getRandomIntegerInputs<char>)
34 ->Arg(TestNumInputs);
36 BENCHMARK_CAPTURE(BM_ConstructFromRange, vector_size_t, std::vector<size_t>{}, getRandomIntegerInputs<size_t>)
37 ->Arg(TestNumInputs);
39 BENCHMARK_CAPTURE(BM_ConstructFromRange, vector_string, std::vector<std::string>{}, getRandomStringInputs)
40 ->Arg(TestNumInputs);
42 BENCHMARK_CAPTURE(BM_Pushback, vector_int, std::vector<int>{})->Arg(TestNumInputs);
44 BENCHMARK_MAIN();