Re: [PATCH 05/10] t-reftable-block: use block_iter_reset() instead of block_iter_close()
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Aug 15, 2024, 09:40 UTC
- Message-ID
- <Zr3NKWOFlZlkkOSn@tanuki>
- In-Reply-To
- <20240814121122.4642-6-chandrapratap3519@gmail.com>
On Wed, Aug 14, 2024 at 05:33:13PM +0530, Chandra Pratap wrote:
Show 9 quoted lines
> block_iter_reset() restores a block iterator to its state at the time > of initialization without freeing any memory while block_iter_close() > deallocates the memory for the iterator. > > In the current testing setup, a block iterator is allocated and > deallocated for every iteration of a loop, which hurts performance. > Improve upon this by using block_iter_reset() at the start of each > iteration instead. This has the added benifit of testing > block_iter_reset(), which currently remains untested.
I don't think that performance is a good argument, but exercising the reset function certainly is.
> Similarly, remove reftable_record_release() for a reftable record > that is still in use.
This is a welcome change, too, to verify that reading into the same record multiple times does not leak memory and otherwise works as expected.
Patrick