Fabcoin Core  0.16.2
P2P Digital Currency
prevector_destructor.cpp
Go to the documentation of this file.
1 // Copyright (c) 2015-2017 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <bench/bench.h>
6 #include <prevector.h>
7 
8 static void PrevectorDestructor(benchmark::State& state)
9 {
10  while (state.KeepRunning()) {
11  for (auto x = 0; x < 1000; ++x) {
14  t0.resize(28);
15  t1.resize(29);
16  }
17  }
18 }
19 
20 static void PrevectorClear(benchmark::State& state)
21 {
22 
23  while (state.KeepRunning()) {
24  for (auto x = 0; x < 1000; ++x) {
27  t0.resize(28);
28  t0.clear();
29  t1.resize(29);
30  t0.clear();
31  }
32  }
33 }
34 
35 BENCHMARK(PrevectorDestructor, 5700);
36 BENCHMARK(PrevectorClear, 5600);
void resize(size_type new_size)
Definition: prevector.h:316
void clear()
Definition: prevector.h:339
BENCHMARK(PrevectorDestructor, 5700)
bool KeepRunning()
Definition: bench.h:70
#define x(i)
#define t1
Implements a drop-in replacement for std::vector<T> which stores up to N elements directly (without h...
Definition: prevector.h:36