summaryrefslogtreecommitdiff
path: root/packv4-parse.h
diff options
context:
space:
mode:
authorNicolas Pitre <nico@fluxnic.net>2013-09-13 20:56:31 -0400
committerNicolas Pitre <nico@fluxnic.net>2013-09-18 00:22:05 -0400
commitaaba410898d4d286835995f7e50f38298445f3d5 (patch)
tree72a2716720d8efd26ff9e860723635d4c79563a8 /packv4-parse.h
parentcc032c50f49c20929bc07cf4308455c28facb928 (diff)
downloadgit-np/pack-v4.tar.gz
packv4-parse.c: add tree offset cachingnp/pack-v4
It is a common pattern to see a tree object copy a few entries from another tree object, possibly from a non zero offset, then provide a few entries of its own just to go back to the previous tree object to copy some more entries. Each time this happens, the tree object being copied has to be parsed from the beginning over again up to the desired offset which is rather wasteful. Let's introduce a tree offset cache to record the entry position and offset when tree parsing stops so a subsequent copy from the same tree object can be resumed without having to start from the beginning all the time. Without doing further tuning on this cache, performing "git rev-list --all --objects | wc -l" on my copy of git.git went from 14.5s down to 6.6s. Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'packv4-parse.h')
-rw-r--r--packv4-parse.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/packv4-parse.h b/packv4-parse.h
index d674a3fad3..b437159b74 100644
--- a/packv4-parse.h
+++ b/packv4-parse.h
@@ -20,6 +20,6 @@ const unsigned char *get_sha1ref(struct packed_git *p,
void *pv4_get_commit(struct packed_git *p, struct pack_window **w_curs,
off_t offset, unsigned long size);
void *pv4_get_tree(struct packed_git *p, struct pack_window **w_curs,
- off_t offset, unsigned long size);
+ off_t obj_offset, unsigned long size);
#endif