While heap-profiling the loading of the Canary ledger, I was surprised by the number of temporary allocations pointing to the ToBits impl for BigInteger256; it appears that the Extend impl that's used there is not able to take advantage of the ExactSizeIterator impl for BitIteratorLE, and we need to be more explicit in order to avoid them.
While heap-profiling the loading of the Canary ledger, I was surprised by the number of temporary allocations pointing to the
ToBits
impl forBigInteger256
; it appears that theExtend
impl that's used there is not able to take advantage of theExactSizeIterator
impl forBitIteratorLE
, and we need to be more explicit in order to avoid them.The results at height 330598 are as follows: