Checksum speedup. (#4968)
authorOlivier Goffart <olivier@woboq.com>
Thu, 16 Jun 2016 06:28:30 +0000 (08:28 +0200)
committerGitHub <noreply@github.com>
Thu, 16 Jun 2016 06:28:30 +0000 (08:28 +0200)
commitb4900d60b76826d17de803ee0c727ac73f4492ba
treeb6e3594b0ee74afdb12f5c8a9e5a06194c707206
parent92309013dae728b66c597697de7572b6d8e50f1a
Checksum speedup. (#4968)

No need to allocate (and initialize to 0) a 10 MiB buffer for each files, even
when most files are much smaller than that.
So make sure the buffer that we allocate is not bigger than the file size.
And Also 10 MiB is a bit big for a buffer. 500 KiB should be more than enough.
(Too big allocations can cause problem because of memory fragmentation and such)
src/libsync/filesystem.cpp