Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was trying to use git to manage my pictures (backup / take snapshots). The entire library is several GB. Most of the files are JPGs of 2-3M. When I was adding the files into repository, it seemed to be taking several days. CPU utilization was always near 100%.

Is there a reason why git should be slow on large files?

p.s. I know git was not designed for this.

share|improve this question

1 Answer 1

Git by default compresses files. JPEGs by default are already compressed. It's not that it's large files, it's that it's compressed files.

You'll notice the same effect adding ZIP files to a git repository.

EDIT: There is an interesting thread on http://stackoverflow.com/questions/7102053/git-pull-without-remotely-compressing-objects about compression.

share|improve this answer
1  
How can I tell git not to compress files? I don't necessarily need space efficiency. I want it to be as fast as possible. Thanks! –  woodings Mar 31 '12 at 4:01
1  
There's a host of switches you can play with in git config, including core.compression and pack.window. Seeing as I've never actually tried running git without compression, YMMV. Please post what you discovered, to help us all learn from your experience. –  user3463 Mar 31 '12 at 4:07
    
@Eroen, you make a good point. I've voted your comment up. –  user3463 Mar 31 '12 at 4:08
    
Git also makes (and checks) a sha1 hash of every file every time it uses it, that can take some time too for large files. –  Eroen Mar 31 '12 at 4:08
2  
@RandolphWest: Good, but wrong. zlib compression can be turned off by $ git set core.compression 0. sha1 is tens of MiB per second, but they might interfere badly with low memory conditions. –  Eroen Mar 31 '12 at 4:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.