Re: [PATCH] don't use mmap() to hash files
Dmitry Potapov <dpotapov@gmail.com> writes:
Show 16 quoted lines
> On Sun, Feb 14, 2010 at 02:53:58AM +0100, Johannes Schindelin wrote:
> > On Sun, 14 Feb 2010, Dmitry Potapov wrote:
> >
> > > + if (strbuf_read(&sbuf, fd, 4096) >= 0)
> >
> > How certain are you at this point that all of fd's contents fit into your
> > memory?
>
> You can't be sure... In fact, we know mmap() also may fail for huge
> files, so can strbuf_read(). Perhaps, mmap() behaves better when you
> want to hash a huge file that does not fit in free physical memory, but
> I do not think it is an important use case for any VCS, which mostly
> stores small text files and a few not so big binary files. Git is not
> design to store your video collection. (probably, Git can be improved to
> handle big files better but I leave that exercise to those who want to
> store their media files in Git).
Something like git-bigfiles: http://caca.zoy.org/wiki/git-bigfiles ?
(found via http://blog.bitquabit.com/2010/02/10/fightings-been-fun-and-all-its-time-shut-and-get-along/
found via http://tomayko.com/, entry for 10 Feb 2010).
--
Jakub Narebski
Poland
ShadeHawk on #git