Speed up gitolite expand

107 views
Skip to first unread message

Marcin Gozdalik

unread,
Jan 26, 2011, 3:24:54 PM1/26/11
to gito...@googlegroups.com
Hello

Recently I noticed that expand command on gitolite on our server is extremely slow - more than 1 minute for a very modest size gitolite installation (10 repositories). After quick debugging I found that expand does a

find . -name "*.git"

in repositories. It turned out that this operation was extremely slow due to some problems on our network drive the gitolite is hosted on. I propose a quick fix to speed up expand:

find . -name "*.git" -prune

which does not recurse into a *.git repository once it found and does not spend time in browsing through all the objects/* directories.

Best regards

--
Marcin Gozdalik

Sitaram Chamarty

unread,
Jan 26, 2011, 5:38:16 PM1/26/11
to Marcin Gozdalik, gito...@googlegroups.com

Thanks. I will make this change.

However, I don't understand how 10 repos take more than a
minute; .git/objects should not have more than 256
subdirectories even in the worst case...

Are you doing this over Samba or something?

Kevin P. Fleming

unread,
Jan 26, 2011, 5:53:59 PM1/26/11
to gito...@googlegroups.com
On 01/26/2011 04:38 PM, Sitaram Chamarty wrote:
> On Wed, Jan 26, 2011 at 09:24:54PM +0100, Marcin Gozdalik wrote:
>> Hello
>>
>> Recently I noticed that expand command on gitolite on our server is
>> extremely slow - more than 1 minute for a very modest size gitolite
>> installation (10 repositories). After quick debugging I found that expand
>> does a
>>
>> find . -name "*.git"
>>
>> in repositories. It turned out that this operation was extremely slow due to
>> some problems on our network drive the gitolite is hosted on. I propose a
>> quick fix to speed up expand:
>>
>> find . -name "*.git" -prune
>>
>> which does not recurse into a *.git repository once it found and does not
>> spend time in browsing through all the objects/* directories.
>
> Thanks. I will make this change.

I would also suggest adding '-type d' in there, since .git will always
be a directory.

--
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfle...@digium.com
Check us out at www.digium.com & www.asterisk.org

Marcin Gozdalik

unread,
Jan 27, 2011, 6:56:26 PM1/27/11
to gito...@googlegroups.com
2011/1/26 Sitaram Chamarty <sit...@atc.tcs.com>
It is not Samba, although it is a network drive which got moved to another DC and there is latency accessing it. -prune makes it bearable (3 seconds vs 90 secs)

--
Marcin Gozdalik
Reply all
Reply to author
Forward
0 new messages