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