Instead of guesstimating that 10000 (or any fixed number) steps
always fit in a buffer, we can just count the bytes as we write.
Depends on D1436
Have you tested the performance impact of this change? Previously we would issue 10k at a time, now if the buffer is 65k and if each entry is 100 bytes (40 byte hash + 60 byte path) then we're only doing 650 at a time. You may need to set remotefilelog.cacheprocess= to force it to fallback to normal ssh fetching to execute this code path in bulk.
i += 1