From: Jeff King Date: Sun, 20 Jul 2025 00:03:59 GMT Subject: Re: [PATCH 1/3] commit: convert pop_most_recent_commit() to prio_queue Message-ID: <20250720000359.GA743449@coredump.intra.peff.net> In-Reply-To: <37f34e15-f44f-4b8a-b684-bda27a977775@web.de> On Sat, Jul 19, 2025 at 01:15:28PM +0200, René Scharfe wrote: > > Hmm, I would have thought prio_queue had less memory overhead. You're > > spending one pointer per entry in a packed array, versus list nodes. But > > it's true that it doesn't shrink as items are removed (though that is > > something we _could_ implement). > > If we just count the net data then a commit_list item has two pointers > and a prio_queue_entry has a pointer and an ID for stability. That's a > tie. ALLOC_GROW overallocates by ca. 50%, so that's 25% more on > average for the prio_queue. No idea what overhead malloc() needs per > allocation, but I guess it's enough to tilt the scale back against > commit_lists. Oh right, I totally forgot about the extra counter. -Peff