Skip to content

bench: use deterministic HexStr payload#34598

Open
l0rinc wants to merge 1 commit intobitcoin:masterfrom
l0rinc:l0rinc/hexstr-bench
Open

bench: use deterministic HexStr payload#34598
l0rinc wants to merge 1 commit intobitcoin:masterfrom
l0rinc:l0rinc/hexstr-bench

Conversation

@l0rinc
Copy link
Contributor

@l0rinc l0rinc commented Feb 16, 2026

Context

Split out of #32554
Inspired by #32457 (comment)

Problem

HexStrBench uses the bytes from the embedded block fixture as a random source of bytes to measure HexStr performance against.
This coupling makes block benchmark migrations in #32554 slightly more work than necessary.

Fix

We can use deterministic pseudo-random bytes instead so this benchmark keeps stable input without fixture coupling.
Use MAX_BLOCK_WEIGHT so the benchmark stays in the same size range and keeps measured work above harness overhead.
This changes the benchmark baseline because input size moves from about 1 MB to 4 MB.

@DrahtBot DrahtBot added the Tests label Feb 16, 2026
@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 16, 2026

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #34448 (ci, iwyu: Fix warnings in src/util and treat them as errors by hebasto)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@fanquake
Copy link
Member

Split out of #32554

Is it currently necessary to split up what is already a single commit PR, into more commits and PRs? Looks like the status of #32554 is that it received review 5 days ago, that hasn't been responded to.

@l0rinc
Copy link
Contributor Author

l0rinc commented Feb 16, 2026

Yes, I'm working on that change currently, that's why I'm splitting out commits from it that make sense on their own.

@l0rinc l0rinc force-pushed the l0rinc/hexstr-bench branch from 045efcf to 4faec2c Compare February 16, 2026 12:10
`HexStrBench` uses the bytes from the embedded block fixture as a random source of bytes to measure `HexStr` performance against.
This coupling makes block benchmark migrations slightly more work than necessary.

We can use deterministic pseudo-random bytes instead so this benchmark keeps stable input without fixture coupling.
Use `MAX_BLOCK_WEIGHT` so the benchmark stays in the same size range and keeps measured work above harness overhead.
This changes the benchmark baseline because input size moves from about 1 MB to 4 MB.

Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
Co-authored-by: Hodlinator <172445034+hodlinator@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants