When reading a batch of data, do you really need to collect it all into a new array first? Agave Draft
#16823 gives a small example: the old path collected the packed ancient storage iterator into a Vec just to call len once; the solution uses the equal-length relationship with the existing packed_contents to get the count, letting the original iterator continue to process lazily. This change focuses on a one-off intermediate collection and does not claim to change account storage semantics or delete historical data. When looking at client memory optimization
$SOL , you can first distinguish necessary results from temporary containers; skipping one collection still requires confirming that the length relationship holds.