Re: [PATCH 1/3] commit: convert pop_most_recent_commit() to prio_queue
- From
René Scharfe <l.s.r@web.de>
- Date
- Jul 17, 2025, 08:22 UTC
- Message-ID
- <03b2e5db-1fb8-4c38-8448-ad320ab7f70f@web.de>
- In-Reply-To
- <b0950e32-b4fa-4aff-8b5c-58c734b880b2@web.de>
On 7/16/25 11:39 AM, René Scharfe wrote:
Show 17 quoted lines
> 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é