Expand description
Production-only batch hashing, preallocation, and related optimization helpers from consensus.
Modules§
- _optimized_
access - Alias module for _optimized_access (for backward compatibility)
- constant_
folding - Constant folding: Pre-compute common hash results
- dead_
code_ elimination - Dead code elimination markers
- optimized_
access - Optimized access using proven bounds
- precomputed_
constants - Pre-computed constants for constant folding optimization
- prefetch
- Memory prefetching optimization
- proven_
bounds - Proven bounds for runtime optimization
- reference_
implementations - Reference implementations for equivalence proofs
- runtime_
assertions - Runtime assertions for optimization correctness
- simd_
vectorization - SIMD Vectorization: Batch hash operations
Structs§
- Cache
Aligned Hash - Memory layout optimization: Cache-friendly hash array
- Compact
Stack Frame - Memory layout optimization: Compact stack frame
Constants§
- BTC_
PER_ SATOSHI - Pre-computed: Inverse of SATOSHIS_PER_BTC (for BTC conversion)
- EMPTY_
STRING_ DOUBLE_ HASH - Pre-computed: Double SHA256 of empty string
- EMPTY_
STRING_ HASH - Pre-computed: SHA256 of empty string
- MAX_
MONEY_ U64 - Pre-computed: MAX_MONEY as u64 (for comparisons)
- ONE_
BTC_ SATOSHIS - Pre-computed: Number of satoshis in 1 BTC (for readability)
- U32_MAX
- Pre-computed: 2^32 - 1 (for 32-bit wrapping checks)
- U64_MAX
- Pre-computed: 2^64 - 1 (used for wrapping arithmetic checks)
Functions§
- is_
empty_ double_ hash - Check if input matches empty string double hash (constant folding)
- is_
empty_ hash - Check if input matches empty string hash (constant folding)
- is_
zero_ hash - Constant-fold: Check if hash is zero (all zeros)
- prealloc_
block_ buffer - Pre-allocate block buffer using proven maximum
- prealloc_
tx_ buffer - Pre-allocate transaction buffer using proven maximum