Skip to content

reduce template bloat in primitive serialization#116

Closed
l0rinc wants to merge 18 commits into
bitcoin-dev-tools:masterfrom
l0rinc:detached124
Closed

reduce template bloat in primitive serialization#116
l0rinc wants to merge 18 commits into
bitcoin-dev-tools:masterfrom
l0rinc:detached124

Conversation

@l0rinc

@l0rinc l0rinc commented Jan 17, 2025

Copy link
Copy Markdown
Collaborator

@github-actions

Copy link
Copy Markdown

📊 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.
🚀 Speedups: mainnet-default: -3.1%, mainnet-large: 0.5%, signet: 0.8%

@willcl-ark willcl-ark force-pushed the master branch 3 times, most recently from d8f185c to dee6377 Compare January 30, 2025 20:00
@willcl-ark willcl-ark force-pushed the master branch 4 times, most recently from 91555c9 to d07e4c3 Compare February 4, 2025 15:13
@willcl-ark willcl-ark force-pushed the master branch 5 times, most recently from d15ce87 to 4203957 Compare February 12, 2025 21:23
@willcl-ark willcl-ark force-pushed the master branch 5 times, most recently from e85040f to b21b38e Compare February 13, 2025 20:08
@l0rinc l0rinc force-pushed the detached124 branch 2 times, most recently from e5f5c33 to 1cd94ec Compare February 14, 2025 00:32
willcl-ark and others added 8 commits February 14, 2025 03:22
willcl-ark and others added 10 commits February 14, 2025 09:12
> 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`
@github-actions

Copy link
Copy Markdown

📊 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.
🚀 Speedups: mainnet-default-instrumented: -8.7%, mainnet-large-instrumented: -5.5%, mainnet-default-uninstrumented: -2.0%, mainnet-large-uninstrumented: -0.4%

@l0rinc l0rinc closed this Feb 15, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants