Skip to content

Commit 221b755

Browse files
committed
Merge branch 'jk/dont-count-existing-objects-twice'
There is a logic to estimate how many objects are in the repository, which is mean to run once per process invocation, but it ran every time the estimated value was requested. * jk/dont-count-existing-objects-twice: packfile: actually set approximate_object_count_valid
2 parents 26a3728 + 67bb65d commit 221b755

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packfile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ unsigned long repo_approximate_object_count(struct repository *r)
923923
count += p->num_objects;
924924
}
925925
r->objects->approximate_object_count = count;
926+
r->objects->approximate_object_count_valid = 1;
926927
}
927928
return r->objects->approximate_object_count;
928929
}

t/perf/p5303-many-packs.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ do
7373
git rev-list --objects --all >/dev/null
7474
'
7575

76+
test_perf "abbrev-commit ($nr_packs)" '
77+
git rev-list --abbrev-commit HEAD >/dev/null
78+
'
79+
7680
# This simulates the interesting part of the repack, which is the
7781
# actual pack generation, without smudging the on-disk setup
7882
# between trials.

0 commit comments

Comments
 (0)