Use prio_queue to improve worst-case performance at the cost of slightly worse best-case performance. Then add and use prio_queue_replace() to recover that loss. commit: convert pop_most_recent_commit() to prio_queue prio-queue: add prio_queue_replace() commit: use prio_queue_replace() in pop_most_recent_commit() commit.c | 14 ++++++-- commit.h | 8 ++--- fetch-pack.c | 13 +++++--- object-name.c | 10 +++--- prio-queue.c | 45 +++++++++++++++++-------- prio-queue.h | 8 +++++ t/perf/p1501-rev-parse-oneline.sh | 55 +++++++++++++++++++++++++++++++ t/unit-tests/u-prio-queue.c | 23 +++++++++++++ walker.c | 11 ++++--- 9 files changed, 153 insertions(+), 34 deletions(-) create mode 100755 t/perf/p1501-rev-parse-oneline.sh -- 2.50.1