summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 703f05a)
raw | patch | inline | side by side (parent: 703f05a)
author | Dan McGee <dpmcgee@gmail.com> | |
Tue, 18 Oct 2011 05:21:21 +0000 (00:21 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 18 Oct 2011 07:16:31 +0000 (00:16 -0700) |
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>
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>
builtin/pack-objects.c | patch | blob | history |
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index a9c67c18ba159c8f04fa6bfff52ed9718965190a..70b757e79256cb30d23547655edba41756c7885b 100644 (file)
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
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)
{