Subject: Re: [PATCH 1/3] commit: convert pop_most_recent_commit() to prio_queue

From: René Scharfe <[email-masked]>
Date: Thu, 17 Jul 2025 10:22:36 +0200

On 7/16/25 11:39 AM, René Scharfe wrote:
> On 7/16/25 7:05 AM, Jeff King wrote:
> 
>> I actually have a series turning rev_info.commits into a prio_queue
>> which I need to polish up (mostly just writing commit messages; I've
>> been running with it for almost 2 years without trouble). Ironically it
>> does not touch this spot, as these commit lists are formed on their own.
> 
> That is not a coincidence.  I had a look at that series and tried to
> reach its goals while keeping rev_info.commits a commit_list.  Why?
> Mostly being vaguely uncomfortable with prio_queue' memory overhead,
> lack of type safety and dual use as a stack.  I still used it, but only
> as local variable, not in the central struct rev_info.
> 
> Anyway, I failed; revision.c::get_revision_1() took an 8% performance
> hit in my versions and none in yours, and I couldn't figure out why.
> Perhaps I should revisit it with the new prio_queue_replace() in hand,
> hmm..
Checked now, and it's still slower.  So I don't see an alternative to
making rev_info.commits a prio_queue.

René