git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] refs/files: use heuristic to decide whether to repack with `--auto`
@ 2024-09-02 13:48 Patrick Steinhardt
  2024-09-02 13:48 ` [PATCH 1/2] t0601: merge tests for auto-packing of refs Patrick Steinhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Patrick Steinhardt @ 2024-09-02 13:48 UTC (permalink / raw)
  To: git

Hi,

I recently noticed that `git maintenance run --auto` always ends up
repacking loose references. This is because the "files" backend does not
yet have any heuristics wired up to decide whether or not packing refs
is in order. The consequence is that we always decided to pack them,
which is of course quite a waste of time.

This small patch series fixes this by introducing a new heuristic for
the "files" backend. The heuristic is rather simple: the bigger the
"packed-refs" file, the more loose refs we require before we decide to
repack. We have been using this heurisitc successfully for a long time
in Gitaly by now.

Thanks!

Patrick

Patrick Steinhardt (2):
  t0601: merge tests for auto-packing of refs
  refs/files: use heuristic to decide whether to repack with `--auto`

 refs/files-backend.c          |  75 +++++++++++++++++++++++++
 refs/packed-backend.c         |  18 ++++++
 refs/packed-backend.h         |   7 +++
 t/t0601-reffiles-pack-refs.sh | 101 ++++++++++++++++++++++++++++------
 4 files changed, 185 insertions(+), 16 deletions(-)

-- 
2.46.0.421.g159f2d50e7.dirty


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-09-05  9:58 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 13:48 [PATCH 0/2] refs/files: use heuristic to decide whether to repack with `--auto` Patrick Steinhardt
2024-09-02 13:48 ` [PATCH 1/2] t0601: merge tests for auto-packing of refs Patrick Steinhardt
2024-09-02 13:48 ` [PATCH 2/2] refs/files: use heuristic to decide whether to repack with `--auto` Patrick Steinhardt
2024-09-03  9:00   ` karthik nayak
2024-09-03  9:23     ` Patrick Steinhardt
2024-09-03 18:23       ` Junio C Hamano
2024-09-04  7:42         ` Patrick Steinhardt
2024-09-04 16:15           ` Junio C Hamano
2024-09-04  8:49     ` Patrick Steinhardt
2024-09-05  8:44       ` karthik nayak
2024-09-04  8:52 ` [PATCH v2 0/3] refs/files: use heuristics " Patrick Steinhardt
2024-09-04  8:53   ` [PATCH v2 1/3] wrapper: introduce `log2u()` Patrick Steinhardt
2024-09-04  8:53   ` [PATCH v2 2/3] t0601: merge tests for auto-packing of refs Patrick Steinhardt
2024-09-04  8:53   ` [PATCH v2 3/3] refs/files: use heuristic to decide whether to repack with `--auto` Patrick Steinhardt
2024-09-04 15:24     ` Junio C Hamano
2024-09-05  9:58       ` Patrick Steinhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).