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
16using namespace ContainerBenchmarks;
17
18constexpr std::size_t TestNumInputs = 1024;
19
20BENCHMARK_CAPTURE(BM_ConstructSize, deque_byte, std::deque<unsigned char>{})->Arg(x: 5140480);
21
22BENCHMARK_CAPTURE(BM_ConstructSizeValue, deque_byte, std::deque<unsigned char>{}, 0)->Arg(x: 5140480);
23
24BENCHMARK_CAPTURE(BM_ConstructIterIter, deque_char, std::deque<char>{}, getRandomIntegerInputs<char>)
25 ->Arg(x: TestNumInputs);
26
27BENCHMARK_CAPTURE(BM_ConstructIterIter, deque_size_t, std::deque<size_t>{}, getRandomIntegerInputs<size_t>)
28 ->Arg(x: TestNumInputs);
29
30BENCHMARK_CAPTURE(BM_ConstructIterIter, deque_string, std::deque<std::string>{}, getRandomStringInputs)
31 ->Arg(x: TestNumInputs);
32
33BENCHMARK_CAPTURE(BM_ConstructFromRange, deque_char, std::deque<char>{}, getRandomIntegerInputs<char>)
34 ->Arg(x: TestNumInputs);
35
36BENCHMARK_CAPTURE(BM_ConstructFromRange, deque_size_t, std::deque<size_t>{}, getRandomIntegerInputs<size_t>)
37 ->Arg(x: TestNumInputs);
38
39BENCHMARK_CAPTURE(BM_ConstructFromRange, deque_string, std::deque<std::string>{}, getRandomStringInputs)
40 ->Arg(x: TestNumInputs);
41
42BENCHMARK_MAIN();
43

source code of libcxx/benchmarks/deque.bench.cpp