From d2c5aeb2c7a2d113eca6ffafd97d508258cf52fd Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Thu, 28 Feb 2008 10:55:47 +0200 Subject: [PATCH] grafthistory: keep the downloaded pack, speed up git gc 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. 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%. --- contrib/grafthistory.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/grafthistory.sh b/contrib/grafthistory.sh index 447a6388..950b385a 100755 --- a/contrib/grafthistory.sh +++ b/contrib/grafthistory.sh @@ -19,6 +19,8 @@ cd "$GIT_DIR" echo "[grafthistory] Downloading the history" mkdir -p objects/pack cd objects/pack +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).