[PATCH 0/4] a few mark_parents_uninteresting cleanups
- From
Jeff King <peff@peff.net>
- Date
- May 11, 2018, 18:00 UTC
- Message-ID
- <20180511180029.GA11290@sigill.intra.peff.net>
This is a follow-up to the discussion from February:
https://public-inbox.org/git/1519522496-73090-1-git-send-email-dstolee@microsoft.com/
There I theorized that some of these extra has_object_file() checks were unnecessary. After poking around a bit, I've convinced myself that this is the case, so here are some patches.
After Stolee's fix in ebbed3ba04 (revision.c: reduce object database queries, 2018-02-24), I doubt this will provide any noticeable speedup. IMHO the value is just in simplifying the logic.
The first two patches are the actual has_object_file simplifications. The second two are an attempt to fix some head-scratching I had while reading mark_parents_uninteresting(). I hope the result is easier to follow, but I may have just shuffled one confusion for another. :)
[1/4]: mark_tree_contents_uninteresting(): drop missing object check [2/4]: mark_parents_uninteresting(): drop missing object check [3/4]: mark_parents_uninteresting(): replace list with stack [4/4]: mark_parents_uninteresting(): avoid most allocation
revision.c | 90 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 40 deletions(-)
-Peff