Re: [PATCH v7 12/13] pack-objects: shrink delta_size field in struct object_entry
- From
Jeff King <peff@peff.net>
- Date
- Mar 30, 2018, 21:24 UTC
- Message-ID
- <20180330212419.GJ14782@sigill.intra.peff.net>
- In-Reply-To
- <20180324063353.24722-13-pclouds@gmail.com>
On Sat, Mar 24, 2018 at 07:33:52AM +0100, Nguyễn Thái Ngọc Duy wrote:
Show 6 quoted lines
> Allowing a delta size of 64 bits is crazy. Shrink this field down to > 31 bits with one overflow bit. > > If we find an existing delta larger than 2GB, we do not cache > delta_size at all and will get the value from oe_size(), potentially > from disk if it's larger than 4GB.
Since we have a fallback, we can put this slider wherever we want. Probably something like 20 bits would be plenty, if we ever needed to squeeze in a few more small-bit items.
Show 6 quoted lines
> @@ -2004,10 +2006,12 @@ static int try_delta(struct unpacked *trg, struct unpacked *src, > delta_buf = create_delta(src->index, trg->data, trg_size, &delta_size, max_size); > if (!delta_buf) > return 0; > + if (delta_size >= (1 << OE_DELTA_SIZE_BITS)) > + return 0;
This is the other spot that needs to be "1U".
How come this doesn't get a pdata->oe_delta_size_limit like we have pdata->oe_size_limit? Would we want a matching $GIT_TEST_OE_DELTA_SIZE_BITS to test it, too?
-Peff