Keep our arrays of sat ranges in the low-level [u8; 11] format, rather than converting them to (u64, u64) and back. Also, don't mutate the input sat ranges in index_transaction_sats(); this avoids the need for a copy in index_utxo_entries() and also makes that code simpler.
Add a fast path for Sat::common(), which avoids a divide and some branch mispredictions.
These changes save almost 2.5 hours of CPU time. The overall speedup is less, though, because indexing now runs fast enough that bitcoind often can't keep up -- we spend a significant amount of time just waiting for it to send us blocks.
Keep our arrays of sat ranges in the low-level
[u8; 11]
format, rather than converting them to(u64, u64)
and back. Also, don't mutate the input sat ranges inindex_transaction_sats()
; this avoids the need for a copy inindex_utxo_entries()
and also makes that code simpler.Add a fast path for
Sat::common()
, which avoids a divide and some branch mispredictions.These changes save almost 2.5 hours of CPU time. The overall speedup is less, though, because indexing now runs fast enough that bitcoind often can't keep up -- we spend a significant amount of time just waiting for it to send us blocks.