forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin#16299: bench: Move generated data to a dedicated transl…
…ation unit 3d60a03 bench: Move generated data to a dedicated translation unit (João Barbosa) Pull request description: With this change multiple benchmarks can use the same data without incurring in a bigger binary. ACKs for top commit: laanwj: code review ACK 3d60a03 Tree-SHA512: 8903bb09e4327c88e585a09bc7df1cbdfc18ebdc5d9c86bf3d6d9252a05eaf18b14ecd2bafdacd82f05a659e4b35ecd301c36011c97f7bf89302793165b00fdc
- Loading branch information
Showing
5 changed files
with
44 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ bench_bench_bitcoin_SOURCES = \ | |
bench/block_assemble.cpp \ | ||
bench/checkblock.cpp \ | ||
bench/checkqueue.cpp \ | ||
bench/data.h \ | ||
bench/data.cpp \ | ||
bench/duplicate_inputs.cpp \ | ||
bench/examples.cpp \ | ||
bench/rollingbloom.cpp \ | ||
|
@@ -76,7 +78,7 @@ CLEAN_BITCOIN_BENCH = bench/*.gcda bench/*.gcno $(GENERATED_BENCH_FILES) | |
|
||
CLEANFILES += $(CLEAN_BITCOIN_BENCH) | ||
|
||
bench/checkblock.cpp: bench/data/block413567.raw.h | ||
bench/data.cpp: bench/data/block413567.raw.h | ||
|
||
bitcoin_bench: $(BENCH_BINARY) | ||
|
||
|
@@ -89,7 +91,7 @@ bitcoin_bench_clean : FORCE | |
%.raw.h: %.raw | ||
@$(MKDIR_P) $(@D) | ||
@{ \ | ||
echo "static unsigned const char $(*F)[] = {" && \ | ||
echo "static unsigned const char $(*F)_raw[] = {" && \ | ||
$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \ | ||
echo "};"; \ | ||
} > "[email protected]" && mv -f "[email protected]" "$@" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright (c) 2019 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include <bench/data.h> | ||
|
||
namespace benchmark { | ||
namespace data { | ||
|
||
#include <bench/data/block413567.raw.h> | ||
const std::vector<uint8_t> block413567{block413567_raw, block413567_raw + sizeof(block413567_raw) / sizeof(block413567_raw[0])}; | ||
|
||
} // namespace data | ||
} // namespace benchmark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2019 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#ifndef BITCOIN_BENCH_DATA_H | ||
#define BITCOIN_BENCH_DATA_H | ||
|
||
#include <cstdint> | ||
#include <vector> | ||
|
||
namespace benchmark { | ||
namespace data { | ||
|
||
extern const std::vector<uint8_t> block413567; | ||
|
||
} // namespace data | ||
} // namespace benchmark | ||
|
||
#endif // BITCOIN_BENCH_DATA_H |