Skip to main content

Module ibd_tuning

Module ibd_tuning 

Source
Expand description

IBD Hardware Tuning

Derives batch verification and parallelization parameters from hardware (CPU count, cache size). Used when config does not supply explicit overrides.

Precedence: Config override (if set) > Hardware-derived > Hardcoded default

Structs§

IbdHardwareProfile
Hardware profile detected at first use.

Constants§

PIPPENGER_MIN_CHUNK
STRAUSS_MIN
libsecp256k1 thresholds: n<64 uses ecmult_multi_simple_var (slow), n>=64 Strauss, n>=88 Pippenger. Chunks of 64-128 use Strauss; chunks of 89+ use Pippenger.

Functions§

chunk_threshold_config_or_hardware
Chunk threshold: single batch when n <= this. Above = split for parallelism. Precedence: config_override > env > hardware-derived > 128. Hardware-derived: many-core (16+) → 96 (more parallelism); few-core → 128.
compute_chunk_ranges
Compute optimal chunk ranges for parallel batch verification. Splits n sigs into num_chunks such that each chunk has >= min_chunk sigs. min_chunk >= 1; smaller chunks use ecmult_multi_simple_var (n<64) but parallelism often wins.
hash_batch_chunk_size
Chunk size for batch hash operations (SHA256, HASH160). Cache-friendly, fits in L1. Hardware-derived from L3 when known (L3/256 clamped 8–32); otherwise 16. Used by simd_vectorization for batch hashing.
min_chunk_size_config_or_hardware
Min chunk size when splitting for parallelism. 128+ uses Pippenger (2-3× faster). Precedence: config_override > env > hardware-derived > 128. Hardware-derived: many-core → 64 (Strauss threshold); few-core → 128.