reduce template bloat in primitive serialization#116
Closed
l0rinc wants to merge 18 commits into
Closed
Conversation
|
📊 Benchmark results for this run (12830053600) will be available at: https://bitcoin-dev-tools.github.io/benchcoin/results/pr-116/12830053600/index.html after the github pages "build and deployment" action has completed. |
d8f185c to
dee6377
Compare
91555c9 to
d07e4c3
Compare
d15ce87 to
4203957
Compare
4203957 to
b491d39
Compare
e85040f to
b21b38e
Compare
e5f5c33 to
1cd94ec
Compare
Co-authored-by: David Gumberg <davidzgumberg@gmail.com> Co-authored-by: Lőrinc <pap.lorinc@gmail.com>
Co-authored-by: fanquake <fanquake@gmail.com>
This is still available in the testing repo: https://github.com/bitcoin-dev-tools/benchcoin-testing
b21b38e to
b938c69
Compare
> build/src/bench/bench_bitcoin -filter='SizeComputerBlock|SerializeBlock|DeserializeBlock' --min-time=10000 | ns/block | block/s | err% | total | benchmark |--------------------:|--------------------:|--------:|----------:|:---------- | 1,059,303.26 | 944.02 | 0.4% | 10.96 | `DeserializeBlock` | 203,574.24 | 4,912.21 | 0.2% | 10.98 | `SerializeBlock` | 11,967.57 | 83,559.13 | 0.1% | 11.00 | `SizeComputerBlock`
Merged multiple template methods into a single constexpr-based implementation to reduce template bloat.
build/src/bench/bench_bitcoin -filter='SizeComputerBlock|SerializeBlock|DeserializeBlockTest|DeserializeAndCheckBlockTest' --min-time=10000 | ns/block | block/s | err% | total | benchmark |--------------------:|--------------------:|--------:|----------:|:---------- | 1,057,682.34 | 945.46 | 0.2% | 10.98 | `DeserializeBlock` | 202,969.03 | 4,926.86 | 0.5% | 10.99 | `SerializeBlock` | 11,994.53 | 83,371.31 | 0.1% | 10.98 | `SizeComputerBlock`
* WriteVarInt calls this for every byte * used for (u)int8_t or std::byte or bool | ns/block | block/s | err% | total | benchmark |--------------------:|--------------------:|--------:|----------:|:---------- | 175,364.13 | 5,702.42 | 0.2% | 1.10 | `SerializeBlock`
| ns/block | block/s | err% | total | benchmark |--------------------:|--------------------:|--------:|----------:|:---------- | 11,390.32 | 87,793.86 | 0.1% | 11.01 | `SizeComputerBlock`
|
📊 Benchmark results for this run (13330909480) will be available at: https://bitcoin-dev-tools.github.io/benchcoin/results/pr-116/13330909480/index.html after the github pages "build and deployment" action has completed. |
5761621 to
8d19012
Compare
andrewtoth
pushed a commit
that referenced
this pull request
Sep 18, 2025
67dc752 cmake, test: Disable tests instead of ignoring them (Hennadii Stepanov) bb9157d cmake, refactor: Switch to `Python3::Interpreter` imported target (Hennadii Stepanov) Pull request description: This PR: 1. Switches to a modern CMake approach by using the `Python3::Interpreter` imported target, which is more robust than using variables. 2. Disables the `util_rpcauth_test` test explicitly instead of silently ignoring it. A build and test log for the case when Python is unavailable is provided below: ``` $ cmake -B build $ cmake --build build -j 16 $ ctest --test-dir build -j $(nproc) -R "^util" Internal ctest changing into directory: /bitcoin/build Test project /bitcoin/build Start 115: util_tests Start 117: util_trace_tests Start 114: util_string_tests Start 116: util_threadnames_tests Start 1: util_rpcauth_test 1/5 Test #1: util_rpcauth_test ................***Not Run (Disabled) 0.00 sec 2/5 Test #114: util_string_tests ................ Passed 0.11 sec 3/5 Test #117: util_trace_tests ................. Passed 0.11 sec 4/5 Test #116: util_threadnames_tests ........... Passed 0.11 sec 5/5 Test #115: util_tests ....................... Passed 0.13 sec 100% tests passed, 0 tests failed out of 4 Total Test time (real) = 0.13 sec The following tests did not run: 1 - util_rpcauth_test (Disabled) ``` ACKs for top commit: purpleKarrot: ACK 67dc752 janb84: tACK 67dc752 Tree-SHA512: 5fc7ebe31ac03f4b8a53ecfcfc1cace0f647a1d2c989651988edae96bdfbbe2dee171714e57cb028e65ead1bb40806a82d9821746451dbf005538601fd33ea88
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bitcoin#31868