Re: [PATCH v2 1/9] commit: avoid allocation in clear_commit_marks_many()
- From
Jeff King <peff@peff.net>
- Date
- Jan 10, 2018, 07:54 UTC
- Message-ID
- <20180110075359.GC16315@sigill.intra.peff.net>
- In-Reply-To
- <d37d0e0d-c703-a70c-cf0b-969e54473557@web.de>
On Mon, Dec 25, 2017 at 06:43:37PM +0100, René Scharfe wrote:
Show 5 quoted lines
> Pass the entries of the commit array directly to clear_commit_marks_1() > instead of adding them to a commit_list first. The function clears the > commit and any first parent without allocation; only higher numbered > parents are added to a list for later treatment. This change extends > that optimization to clear_commit_marks_many().
It took a bit of head-scratching to see that is indeed what clear_commit_marks_1 does. I suspect this doesn't make all that big a difference in practice (after all, we're doing an allocation for each merge anyway, so allocating for the tips is likely to be a subset), but it doesn't hurt to do so.
-Peff