]> git.proxmox.com Git - libgit2.git/commit - src/pack.c
odb: avoid inflating the full delta to read the header
authorCarlos Martín Nieto <cmn@dwim.me>
Wed, 27 Apr 2016 10:00:31 +0000 (12:00 +0200)
committerCarlos Martín Nieto <cmn@dwim.me>
Mon, 2 May 2016 15:37:26 +0000 (17:37 +0200)
commita97b769a0ef7fe8b301c07280c9b80233bb77643
treeb7689ab05499e22ca4b9787f12a30a437b7e9547
parent88284dfb7905c5990babb4238b7cd30bdf823500
odb: avoid inflating the full delta to read the header

When we read the header, we want to know the size and type of the
object. We're currently inflating the full delta in order to read the
first few bytes. This can mean hundreds of kB needlessly inflated for
large objects.

Instead use a packfile stream to read just enough so we can read the two
varints in the header and avoid inflating most of the delta.
src/delta-apply.c
src/delta-apply.h
src/pack.c