1 | //===----------------------------------------------------------------------===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #include <deque> |
10 | |
11 | #include "benchmark/benchmark.h" |
12 | |
13 | #include "ContainerBenchmarks.h" |
14 | #include "GenerateInput.h" |
15 | |
16 | using namespace ContainerBenchmarks; |
17 | |
18 | constexpr std::size_t TestNumInputs = 1024; |
19 | |
20 | BENCHMARK_CAPTURE(BM_ConstructSize, deque_byte, std::deque<unsigned char>{})->Arg(5140480); |
21 | |
22 | BENCHMARK_CAPTURE(BM_ConstructSizeValue, deque_byte, std::deque<unsigned char>{}, 0)->Arg(5140480); |
23 | |
24 | BENCHMARK_CAPTURE(BM_ConstructIterIter, deque_char, std::deque<char>{}, getRandomIntegerInputs<char>) |
25 | ->Arg(TestNumInputs); |
26 | |
27 | BENCHMARK_CAPTURE(BM_ConstructIterIter, deque_size_t, std::deque<size_t>{}, getRandomIntegerInputs<size_t>) |
28 | ->Arg(TestNumInputs); |
29 | |
30 | BENCHMARK_CAPTURE(BM_ConstructIterIter, deque_string, std::deque<std::string>{}, getRandomStringInputs) |
31 | ->Arg(TestNumInputs); |
32 | |
33 | BENCHMARK_CAPTURE(BM_ConstructFromRange, deque_char, std::deque<char>{}, getRandomIntegerInputs<char>) |
34 | ->Arg(TestNumInputs); |
35 | |
36 | BENCHMARK_CAPTURE(BM_ConstructFromRange, deque_size_t, std::deque<size_t>{}, getRandomIntegerInputs<size_t>) |
37 | ->Arg(TestNumInputs); |
38 | |
39 | BENCHMARK_CAPTURE(BM_ConstructFromRange, deque_string, std::deque<std::string>{}, getRandomStringInputs) |
40 | ->Arg(TestNumInputs); |
41 | |
42 | BENCHMARK_MAIN(); |
43 | |