]> git.ipfire.org Git - thirdparty/git.git/commit - tree-walk.c
tree-walk: report recursion counts
authorDerrick Stolee <dstolee@microsoft.com>
Mon, 4 Jan 2021 03:09:10 +0000 (03:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Jan 2021 23:23:08 +0000 (15:23 -0800)
commitda8be8ced672fc00d5dea8a95d04854b2e35d925
tree9100788639e776adb35ea93102362a12cd7b683f
parent71ca53e8125e36efbda17293c50027d31681a41f
tree-walk: report recursion counts

The traverse_trees() method recursively walks through trees, but also
prunes the tree-walk based on a callback. Some callers, such as
unpack_trees(), are quite complicated and can have wildly different
performance between two different commands.

Create constants that count these values and then report the results at
the end of a process. These counts are cumulative across multiple "root"
instances of traverse_trees(), but they provide reproducible values for
demonstrating improvements to the pruning algorithm when possible.

This change is modeled after a similar statistics reporting in 42e50e78
(revision.c: add trace2 stats around Bloom filter usage, 2020-04-06).

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tree-walk.c