File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ bench_bench_bitcoin_SOURCES = \
24
24
bench/base58.cpp \
25
25
bench/lockedpool.cpp \
26
26
bench/perf.cpp \
27
- bench/perf.h
27
+ bench/perf.h \
28
+ bench/prevector_destructor.cpp
28
29
29
30
nodist_bench_bench_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
30
31
Original file line number Diff line number Diff line change
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.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) {
12
+ prevector<28 , unsigned char > t0;
13
+ prevector<28 , unsigned char > t1;
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) {
25
+ prevector<28 , unsigned char > t0;
26
+ prevector<28 , unsigned char > t1;
27
+ t0.resize (28 );
28
+ t0.clear ();
29
+ t1.resize (29 );
30
+ t0.clear ();
31
+ }
32
+ }
33
+ }
34
+
35
+ BENCHMARK (PrevectorDestructor);
36
+ BENCHMARK (PrevectorClear);
You can’t perform that action at this time.
0 commit comments