• Nicolas Pitre's avatar
    [PATCH] don't load and decompress objects twice with parse_object() · bd2c39f5
    Nicolas Pitre authored
    It turns out that parse_object() is loading and decompressing given
    object to free it just before calling the specific object parsing
    function which does mmap and decompress the same object again. This
    patch introduces the ability to parse specific objects directly from a
    memory buffer.
    Without this patch, running git-fsck-cache on the kernel repositorytake:
    	real    0m13.006s
    	user    0m11.421s
    	sys     0m1.218s
    With this patch applied:
    	real    0m8.060s
    	user    0m7.071s
    	sys     0m0.710s
    The performance increase is significant, and this is kind of a
    prerequisite for sane delta object support with fsck.
    Signed-off-by: default avatarNicolas Pitre <nico@cam.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
blob.c 1.23 KB