File tree Expand file tree Collapse file tree 3 files changed +89
-1
lines changed Expand file tree Collapse file tree 3 files changed +89
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,8 @@ endif()
140
140
141
141
cmake_dependent_option (ENABLE_EXTERNAL_SIGNER "Enable external signer support." ON "NOT WIN32" OFF )
142
142
143
+ option (BUILD_BENCH "Build bench_bitcoin executable." OFF )
144
+
143
145
set (configure_warnings )
144
146
145
147
include (CheckPIESupported )
@@ -264,7 +266,7 @@ target_link_libraries(core_interface INTERFACE
264
266
include (AddBoostIfNeeded )
265
267
add_boost_if_needed ()
266
268
267
- if (BUILD_DAEMON OR BUILD_CLI OR BUILD_TESTS )
269
+ if (BUILD_DAEMON OR BUILD_CLI OR BUILD_TESTS OR BUILD_BENCH )
268
270
find_package (Libevent 2.1.8 MODULE REQUIRED )
269
271
endif ()
270
272
@@ -320,6 +322,7 @@ message(" ZeroMQ .............................. ${WITH_ZMQ}")
320
322
message (" USDT tracing ........................ ${WITH_USDT} " )
321
323
message ("Tests:" )
322
324
message (" test_bitcoin ........................ ${BUILD_TESTS} " )
325
+ message (" bench_bitcoin ....................... ${BUILD_BENCH} " )
323
326
message ("" )
324
327
message ("C++ compiler .......................... ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} , ${CMAKE_CXX_COMPILER} " )
325
328
include (FlagsSummary )
Original file line number Diff line number Diff line change @@ -339,6 +339,10 @@ endif()
339
339
340
340
341
341
add_subdirectory (test /util )
342
+ if (BUILD_BENCH )
343
+ add_subdirectory (bench )
344
+ endif ()
345
+
342
346
if (BUILD_TESTS )
343
347
add_subdirectory (test )
344
348
endif ()
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2023-present The Bitcoin Core developers
2
+ # Distributed under the MIT software license, see the accompanying
3
+ # file COPYING or https://opensource.org/license/mit/.
4
+
5
+ include (GenerateHeaders )
6
+ generate_header_from_raw (data/block413567.raw )
7
+
8
+ add_executable (bench_bitcoin
9
+ bench_bitcoin.cpp
10
+ bench.cpp
11
+ data.cpp
12
+ nanobench.cpp
13
+ ${CMAKE_CURRENT_BINARY_DIR} /data/block413567.raw.h
14
+ # Benchmarks:
15
+ addrman.cpp
16
+ base58.cpp
17
+ bech32.cpp
18
+ bip324_ecdh.cpp
19
+ block_assemble.cpp
20
+ ccoins_caching.cpp
21
+ chacha20.cpp
22
+ checkblock.cpp
23
+ checkblockindex.cpp
24
+ checkqueue.cpp
25
+ cluster_linearize.cpp
26
+ crypto_hash.cpp
27
+ descriptors.cpp
28
+ disconnected_transactions.cpp
29
+ duplicate_inputs.cpp
30
+ ellswift.cpp
31
+ examples.cpp
32
+ gcs_filter.cpp
33
+ hashpadding.cpp
34
+ index_blockfilter.cpp
35
+ load_external.cpp
36
+ lockedpool.cpp
37
+ logging.cpp
38
+ mempool_eviction.cpp
39
+ mempool_stress.cpp
40
+ merkle_root.cpp
41
+ parse_hex.cpp
42
+ peer_eviction.cpp
43
+ poly1305.cpp
44
+ pool.cpp
45
+ prevector.cpp
46
+ random.cpp
47
+ readblock.cpp
48
+ rollingbloom.cpp
49
+ rpc_blockchain.cpp
50
+ rpc_mempool.cpp
51
+ sign_transaction.cpp
52
+ streams_findbyte.cpp
53
+ strencodings.cpp
54
+ util_time.cpp
55
+ verify_script.cpp
56
+ xor.cpp
57
+ )
58
+
59
+ target_link_libraries (bench_bitcoin
60
+ core_interface
61
+ test_util
62
+ bitcoin_node
63
+ Boost::headers
64
+ )
65
+
66
+ if (ENABLE_WALLET )
67
+ target_sources (bench_bitcoin
68
+ PRIVATE
69
+ coin_selection.cpp
70
+ wallet_balance.cpp
71
+ wallet_create.cpp
72
+ wallet_create_tx.cpp
73
+ wallet_loading.cpp
74
+ wallet_ismine.cpp
75
+ )
76
+ target_link_libraries (bench_bitcoin bitcoin_wallet )
77
+ endif ()
78
+
79
+ add_test (NAME bench_sanity_check_high_priority
80
+ COMMAND bench_bitcoin -sanity-check -priority-level=high
81
+ )
You can’t perform that action at this time.
0 commit comments