Re:Adding Mercurial support to Gitlab
by voltagex_ on Thursday September 20, 2018 @12:57AM
(#18029887)
How is git clone faster than `cp -r`?
[ Parent
| on HN ]
Re:Adding Mercurial support to Gitlab
by LukeShu on Thursday September 20, 2018 @01:13AM
(#18029938)
http://gitolite.com/git-performance.html (the obvious answer)
https://apenwarr.ca/log/20080121 (some more nuance)
Re:Adding Mercurial support to Gitlab
by simcop2387 on Thursday September 20, 2018 @01:09AM
(#18029924)
My first guess would be that git is going to be faster since it won't be doing a huge number of stat() calls and similar to grab metadata about the files it's creating, instead git will have the data in a single data structure it can efficiently ask for it from. Of course the filesystem has this too, but git will have it in a single location and probably more compactly, leaving it able to do it all with fewer reads. Then it has the data in the files compressed so the read is faster too. All this should mean that git can get to writing the files faster than cp will.
Re:Adding Mercurial support to Gitlab
by dleslie on Thursday September 20, 2018 @01:04AM
(#18029910)
It may be in relation to when you duplicate a repository.
When you cp an active git repository you receive an identical file state; when you git clone you receive only what is necessary. Old objects, reflogs, et al aren't in the clone. A clone of an existing local repository may also make hard links, if your file system supports it.