1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

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%.
This commit is contained in:
Kalle Olavi Niemitalo 2008-02-28 10:55:47 +02:00 committed by Kalle Olavi Niemitalo
parent 3aecdfc095
commit d2c5aeb2c7

View File

@ -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).