Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 2/2] Implement a simple delta_base cache

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:00

Nicolas Pitre [off-list ref] writes:
A malloc() + memcpy() will always be faster than mmap() + malloc() + 
inflate().  If the data is already there it is certainly better to copy 
it straight away.
I do not know if there is mmap() cost involved, but you are
correct to point out that my aversion to malloc() cost was
unfounded.  We need to allocate anyway, and memcpy() should of
course be cheaper than inflate().
With the patch below I can do 'git log drivers/scsi/ > /dev/null' about 
7% faster.  I bet it might be even more on those platforms with bad 
mmap() support.
Wonderful.  I was going to nitpick but you even took care of the
convention of returning a buffer with one extra byte that
terminates the contents with NUL.  Perfect.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help