[patch/rfc] grafthistory: keep the downloaded pack, speed up git gc

Kalle Olavi Niemitalo <[email protected]>
Newsgroups gmane.comp.web.links
Message-ID <[email protected]>
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 <[email protected]> Sun, 24 Feb 2008 22:25:30 +0200
committer Kalle Olavi Niemitalo <[email protected]> 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).

_______________________________________________
elinks-dev mailing list
[email protected]
http://linuxfromscratch.org/mailman/listinfo/elinks-dev
signature.asc (application/pgp-signature, 188 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHwdXcHm9IGt60eMgRAnOhAJ9/RvCoE2lSHZTMOlrc/F+8VlMqJgCgu2t1
tfSea6sjLCfbmht2skFqnyA=
=fMoW
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.