From f2f749abe0e128d411b3f3ded9ea96b636233588 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Mon, 29 Mar 2010 07:53:35 +1100 Subject: [PATCH] QA /technical/2010/02/git-object-store-efficiency/ --- .../2010/02/git-object-store-efficiency.html | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/content/technical/2010/02/git-object-store-efficiency.html b/content/technical/2010/02/git-object-store-efficiency.html index fa37e6a..7c0d67f 100644 --- a/content/technical/2010/02/git-object-store-efficiency.html +++ b/content/technical/2010/02/git-object-store-efficiency.html @@ -1,42 +1,45 @@ Hubert Feyrer posted, Musing about git's object store efficiency yesterday. In it he compared the apparent efficiency of git's object store to CVS's stacked patches. His methodology was to checkout all 963 versions of the NetBSD i386 GENERIC kernel configuration file and then sum up the space used. He comes to the following conclusion: -
the git model requires about 37 times the space that CVS does
+> the git model requires about 37 times the space that CVS does and: -
that's not counting the overhead of 962 inodes and the related directory bookkeeping
+> that's not counting the overhead of 962 inodes and the related directory bookkeeping He finishes off with an acknowledgement that git has data packing features: -
I know that git offers some more efficient storage methods via "pack" files, but investigating those is left as an exercise to the reader.
+ +> I know that git offers some more efficient storage methods via "pack" files, but investigating those is left as an exercise to the reader. I generally enjoy Hubert's posts but as a daily user of git this one didn't sit right with me. I thought I'd take up the aforementioned exercise. -I retrieved the GENERIC,v rcs file1 and created a git repository2. + + +I retrieved the GENERIC,v rcs file1 and created a git repository2. I then ran a script3, which committed each revision of the file along with a single line commit message extracted from the rcs log. -The repository then weighed in at 22,352kb4 with 3,174 files and directories5. This is where git-gc comes in. From the man page, "git-gc - Cleanup unnecessary files and optimize the local repository". After running git gc6 the size of the repository was down to 1,068kb, 1.24 times the rcs file. The file and directory count also vastly smaller at 64. +The repository then weighed in at 22,352kb4 with 3,174 files and directories5. This is where `git-gc` comes in. From the man page, "git-gc - Cleanup unnecessary files and optimize the local repository". After running `git gc`6 the size of the repository was down to 1,068kb, 1.24 times the rcs file. The file and directory count also vastly smaller at 64. -So all in all git fares pretty well. Sure the repository is bigger than CVS and there's a few more files but its not in order Hubert suggests and its a small price to pay for all the benefits git provides. +So all in all git fares pretty well. Sure the repository is bigger than CVS and there's a few more files but its not in the order Hubert suggests and its a small price to pay for all the benefits git provides. ________________________ -1. From ftp.netbsd.org. +1\. From ftp.netbsd.org. -2. +2\.
mkdir git
 cd git
 git init
 Initialized empty Git repository in /Users/wmoore/Source/NetBSD i386 GENERIC/git/.git/
-3. +3\. -4. Repository sizes detemined via: +4\. Repository sizes detemined via:
du -sk .
-5. File and directory counts determined via: +5\. File and directory counts determined via:
find . | wc -l
-6. +6\.
git gc
 Counting objects: 2871, done.
 Delta compression using up to 2 threads.