summaryrefslogtreecommitdiff
path: root/t/t4013/diff.format-patch_--stdout_initial..master
diff options
context:
space:
mode:
authorKristofer Karlsson <krka@spotify.com>2026-05-27 15:50:02 +0000
committerJunio C Hamano <gitster@pobox.com>2026-05-28 06:08:20 +0900
commitdd4bc01c0a8fc871a68a5027ed5ac953fa47fc6e (patch)
tree39ce1c5d0a2606c15bf21fcda26e773d1948ada5 /t/t4013/diff.format-patch_--stdout_initial..master
parentd877b1af507a6aaf55e8643eb73277a30d3a800b (diff)
revision: use priority queue for non-limited streaming walks
The streaming (non-limited) walk in get_revision_1() inserts newly discovered parent commits into a date-sorted queue via commit_list_insert_by_date(), which scans the linked list to find the insertion point -- O(w) per insert, where w is the width of the active walk frontier. Replace this with an O(log w) priority queue. Add a commit_queue field to rev_info alongside the existing commits linked list. The two representations are mutually exclusive: setup and external callers that need list access use the linked list, then get_revision_1() lazily drains it into the priority queue on first call. Add a REV_WALK_NO_WALK enum value to distinguish the no_walk case (which still uses the commit list) from the streaming case. The conversion function rev_info_commit_list_to_queue() is public so callers that know they will iterate can convert early. Combined with the limit_list() priority queue change already in master, this eliminates all O(w) sorted linked-list insertion from the revision walk machinery. Signed-off-by: Kristofer Karlsson <krka@spotify.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.format-patch_--stdout_initial..master')
0 files changed, 0 insertions, 0 deletions