[elinks-dev] [patch/rfc] grafthistory: keep the downloaded pack, speed up git gc
Kalle Olavi Niemitalo
kon at iki.fi
Sun Feb 24 13:38:40 MST 2008
To segregate the historical commits (can't remember why),
I originally placed their pack in an alternate object store,
but later I found that a *.keep file does the job as well.
This gives a considerable speedup in git gc. It takes some
more disk space but OTOH you might then run gc more often
and have fewer loose objects.
OK to push?
grafthistory: keep the downloaded pack, speed up git gc
---
commit df62c12c7e3a1153652d775101a1330f5b8156d8
tree 76b269ff5a291e6916713a0088881a2f6a1abdd3
parent 6139c2ffb5127a75aec176167e22298c693d339a
author Kalle Olavi Niemitalo <kon at iki.fi> Sun, 24 Feb 2008 22:25:30 +0200
committer Kalle Olavi Niemitalo <Kalle at Astalo.kon.iki.fi> Sun, 24 Feb 2008 22:25:30 +0200
contrib/grafthistory.sh | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/contrib/grafthistory.sh b/contrib/grafthistory.sh
index 447a638..7dd5ebc 100755
--- a/contrib/grafthistory.sh
+++ b/contrib/grafthistory.sh
@@ -19,6 +19,16 @@ cd "$GIT_DIR"
echo "[grafthistory] Downloading the history"
mkdir -p objects/pack
cd objects/pack
+# real user sys (tested in this order)
+# 1m15.900s 0m59.732s 0m4.336s gc after clone&graft without *.keep
+# 0m23.162s 0m17.549s 0m1.588s gc after clone&graft with *.keep
+# 0m06.932s 0m04.440s 0m0.588s gc after clone&graft&gc with *.keep
+# 0m32.214s 0m24.138s 0m2.284s gc after clone&graft&gc without *.keep
+# Total size of .git/objects/pack/ was 90592 KiB without *.keep
+# and 97397 KiB with *.keep. So *.keep reduced gc time by 70-80%
+# but increased disk space usage by 7.5%.
+echo "ELinks history converted from CVS. Keep this pack separate to speed up git gc." \
+ > pack-0d6c5c67aab3b9d5d9b245da5929c15d79124a48.keep
# pack-0d6c5c67aab3b9d5d9b245da5929c15d79124a48.idx is 3163784 bytes long.
# Downloading it takes less than 6 seconds here, whereas generating it
# with git index-pack takes over 4 minutes (750 MHz Duron, git 1.5.4.1).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://linuxfromscratch.org/pipermail/elinks-dev/attachments/20080224/b8585b4f/attachment.bin
More information about the elinks-dev
mailing list