summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorDan McGee <dpmcgee@gmail.com>2011-10-18 05:21:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-10-18 07:16:31 (GMT)
commitbe12681896fab9455eb65ea124df423b462e0072 (patch)
tree7a4e91fda2ebca5c5b049134152fdf2568d0cad9 /builtin/pack-objects.c
parent703f05ad5835cff92b12c29aecf8d724c8c847e2 (diff)
downloadgit-be12681896fab9455eb65ea124df423b462e0072.zip
git-be12681896fab9455eb65ea124df423b462e0072.tar.gz
git-be12681896fab9455eb65ea124df423b462e0072.tar.bz2
pack-objects: mark add_to_write_order() as inline
This function is a whole 26 bytes when compiled on x86_64, but is currently invoked over 1.037 billion times when running pack-objects on the Linux kernel git repository. This is hitting the point where micro-optimizations do make a difference, and inlining it only increases the object file size by 38 bytes. As reported by perf, this dropped task-clock from 84183 to 83373 ms, and total cycles from 223.5 billion to 221.6 billion. Not astronomical, but worth getting for adding one word. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index a9c67c1..70b757e 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -454,7 +454,7 @@ static int mark_tagged(const char *path, const unsigned char *sha1, int flag,
return 0;
}
-static void add_to_write_order(struct object_entry **wo,
+static inline void add_to_write_order(struct object_entry **wo,
int *endp,
struct object_entry *e)
{