Avoid unnecessarily inflating and interpreting delta
PATCH 1/1 Avoid unnecessarily inflating and interpreting delta
This teaches packed_delta_info() that it only needs to look at the type of the base object to figure out both type and size of a deltified object. This saves quite a many calls to inflate() when dealing with a deep delta chain.
Signed-off-by Junio C Hamano <[email protected]>
---
cat-file.c | 3 ++ sha1_file.c | 77 +++++++++++++++++++++++++++++++---------------------------- 2 files changed, 43 insertions(+), 37 deletions(-)
f0792cd64bd42cde6706dc2c039e7b6901547169
cat-file.c +2 -1
@@ -16,7 +16,8 @@ int main(int argc, char **argv)usage ("git-cat-file [-t | -s | tagname] <sha1>" );if (!strcmp ("-t" , argv[1 ]) || !strcmp ("-s" , argv[1 ])) { -if (!sha1_object_info (sha1, type, &size)) { +if (!sha1_object_info (sha1, type, + argv[1 ][1 ] =='s' ? &size :NULL )) {switch (argv[1 ][1 ]) {case 't' :printf ("%s\n" , type);
sha1_file.c +41 -36
108 lines not on this page · raw message
------------