Raven Core
3.0.0
P2P Digital Currency
src
bench
prevector_destructor.cpp
Go to the documentation of this file.
1
// Copyright (c) 2015-2017 The Bitcoin Core developers
2
// Copyright (c) 2017-2019 The Raven Core developers
3
// Distributed under the MIT software license, see the accompanying
4
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6
#include "
bench.h
"
7
#include "
prevector.h
"
8
9
static
void
PrevectorDestructor(
benchmark::State
& state)
10
{
11
while
(state.
KeepRunning
()) {
12
for
(
auto
x = 0; x < 1000; ++x) {
13
prevector<28, unsigned char>
t0;
14
prevector<28, unsigned char>
t1;
15
t0.
resize
(28);
16
t1.
resize
(29);
17
}
18
}
19
}
20
21
static
void
PrevectorClear(
benchmark::State
& state)
22
{
23
24
while
(state.
KeepRunning
()) {
25
for
(
auto
x = 0; x < 1000; ++x) {
26
prevector<28, unsigned char>
t0;
27
prevector<28, unsigned char>
t1;
28
t0.
resize
(28);
29
t0.
clear
();
30
t1.
resize
(29);
31
t0.
clear
();
32
}
33
}
34
}
35
36
BENCHMARK
(PrevectorDestructor);
37
BENCHMARK
(PrevectorClear);
prevector::resize
void resize(size_type new_size)
Definition:
prevector.h:317
prevector::clear
void clear()
Definition:
prevector.h:340
prevector.h
benchmark::State::KeepRunning
bool KeepRunning()
Definition:
bench.cpp:44
prevector
Implements a drop-in replacement for std::vector<T> which stores up to N elements directly (without h...
Definition:
prevector.h:37
bench.h
BENCHMARK
BENCHMARK(PrevectorDestructor)
benchmark::State
Definition:
bench.h:41
Generated on Mon Jul 29 2019 02:32:17 for Raven Core by
1.8.13