Experiment: 20b404d
rad experiment show 20b404dfcac87d16d26d70af1cfe4b76daa4889f
by ee@did:key:z6MkvsiybCuk1WDZhh2aXDx7NTiZejKgWZygMNsUuXDMNvVQ · Apr 20 11:22 2026
Remove runtime assert_eq! sanity check from fixed-width decoder macro to trim scalar read overhead in release builds.
Measurements
MetricBaselineThe benchmark measurement of the unmodified codeCandidateThe code with the proposed optimization appliedCandidate/Parent ΔThe performance change from baseline to candidate
total_ns (ns) primary
Reduce the median per-iteration time of the existing nightly libtest deserialization benches in `rust-bitcoin`.
2385.640 ns (n=1)2423.260 ns (n=1)+1.57% REGRESSED
block_deserialize_ns secondary2296.040 (n=1)2331.310 (n=1)+1.53%
tx_deserialize_ns secondary89.600 (n=1)91.950 (n=1)+2.62%
Annotations
hypothesisEvery fixed-width integer decode pays the decoder_fn macro's assert_eq! path, so removing that release-time check might shave repeated scalar reads throughout transaction and block parsing.
learnedThere may be a small benefit in trimming decoder scaffolding, but it is materially smaller than the transaction-level inlining win.
next_action_hintIf scalar-read micro-optimizations continue to show small wins, consider only combinations that also preserve the stronger transaction-level inline gains.
rollback_reasonThis improved over baseline but not over the current best inline-only commit, so the gain was too small or too noisy to justify keeping separately.
Base CommitThe starting commit before the optimization was applied38be5dc18492a142d302abe173d1d13e606d78ea
Candidate CommitThe code with the proposed optimization appliedno new code recorded — metadata only
Bench scriptbbbe9e6bd4e6
bench_cmdbash autoresearch.sh
Schemav5
Environment
Archaarch64
OSDarwin 14.6.1
CPUApple M2
Agentpi-autoresearch / pi
Files—