From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Daniel Barkalow <barkalow@iabervon.org>
Subject: [PATCH 0/4] Teach "git clone" to pack refs
Date: Sun, 15 Jun 2008 16:02:03 +0200 [thread overview]
Message-ID: <200806151602.03445.johan@herland.net> (raw)
(This is meant for AFTER v1.5.6.)
This is a re-post of the series I posted while builtin-clone was still
under development. The rationale for this series can be found in earlier
threads, but it roughly boils down to the following:
1. "git clone" currently creates "loose" refs for every ref in the cloned
repo. A subsequent "git gc" will pack these refs into a packed-refs file.
Having "git clone" produce the "packed" refs in the first place seems
more efficient.
2. For repos with few refs the performance difference between writing loose
refs and packed refs is negligible. However, for repos with thousands of
refs [1], the difference between writing one packed-refs file and
thousands of "loose" refs files is definitely noticeable. Even more so
on Windows.
3. When the user updates a ref, a "loose" ref is written, and the
corresponding packed ref (if any) is left unused. By making "git clone"
write packed refs, we increase the overhead of unused packed refs
(proportionally to the number of refs updated by the user). However,
the number of refs updated by the user is typically small. If the user
updates tens - or even hundreds - of refs, I still expect this overhead
to be negligible, and in any case outweighed by the added performance
when cloning repos with many refs.
The series is based on current 'next'.
Johan Herland (4):
Incorporate fetched packs in future object traversal
Move pack_refs() and friends into libgit
Prepare testsuite for a "git clone" that packs refs
Teach "git clone" to pack refs
Makefile | 2 +
builtin-clone.c | 8 ++-
builtin-fetch-pack.c | 1 +
builtin-pack-refs.c | 121 +-----------------------------------------
pack-refs.c | 117 ++++++++++++++++++++++++++++++++++++++++
pack-refs.h | 18 ++++++
t/t5515-fetch-merge-logic.sh | 19 +++++++
7 files changed, 164 insertions(+), 122 deletions(-)
create mode 100644 pack-refs.c
create mode 100644 pack-refs.h
Have fun! :)
...Johan
[1]: At $dayjob I'm converting old CVS modules with up to ~10 years of
history, and some of the resulting repos have ~30000 refs (mostly
build tags). When cloning these repos, the speedup of this series
can be measured in seconds on Linux; minutes on Windows.
next reply other threads:[~2008-06-15 14:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-15 14:02 Johan Herland [this message]
2008-06-15 14:04 ` [PATCH 1/4] Incorporate fetched packs in future object traversal Johan Herland
2008-06-15 14:05 ` [PATCH 2/4] Move pack_refs() and friends into libgit Johan Herland
2008-06-15 17:52 ` Jeff King
2008-06-15 21:27 ` [PATCH 2/4 v2] " Johan Herland
2008-06-15 14:05 ` [PATCH 3/4] Prepare testsuite for a "git clone" that packs refs Johan Herland
2008-06-15 17:54 ` Jeff King
2008-06-15 18:04 ` Jakub Narebski
2008-06-15 23:16 ` [PATCH 3/4 v2] " Johan Herland
2008-06-15 14:06 ` [PATCH 4/4] Teach "git clone" to pack refs Johan Herland
2008-06-15 17:56 ` Jeff King
2008-06-15 22:03 ` Johan Herland
2008-06-16 9:57 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200806151602.03445.johan@herland.net \
--to=johan@herland.net \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).