* Re: [PATCH] delta micro optimization
2006-02-10 20:00 7% ` Junio C Hamano
@ 2006-02-10 20:38 7% ` Nicolas Pitre
0 siblings, 0 replies; 3+ results
From: Nicolas Pitre @ 2006-02-10 20:38 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Fri, 10 Feb 2006, Junio C Hamano wrote:
> That looks obviously correct but it really is micro. Have you
> benched it? On which architectures? Does it help everywhere or
> register starved ones benefit more than others?
I doubt the performance difference would be measurable on i386 although
the code is a bit smaller.
On ARM it causes a code reduction of 12.5% in count-delta.o.
Nicolas
^ permalink raw reply [relevance 7%]
* Re: [PATCH] delta micro optimization
2006-02-10 18:42 7% [PATCH] delta micro optimization Nicolas Pitre
@ 2006-02-10 20:00 7% ` Junio C Hamano
2006-02-10 20:38 7% ` Nicolas Pitre
0 siblings, 1 reply; 3+ results
From: Junio C Hamano @ 2006-02-10 20:00 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: git
That looks obviously correct but it really is micro. Have you
benched it? On which architectures? Does it help everywhere or
register starved ones benefit more than others?
^ permalink raw reply [relevance 7%]
* [PATCH] delta micro optimization
@ 2006-02-10 18:42 7% Nicolas Pitre
2006-02-10 20:00 7% ` Junio C Hamano
0 siblings, 1 reply; 3+ results
From: Nicolas Pitre @ 2006-02-10 18:42 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
My kernel work habit made me look at the generated assembly for the
delta code, and one obvious albeit small improvement is this patch.
Signed-off-by: Nicolas Pitre <nico@cam.org>
---
diff --git a/delta.h b/delta.h
index 31d1820..a15350d 100644
--- a/delta.h
+++ b/delta.h
@@ -19,14 +19,14 @@ extern void *patch_delta(void *src_buf,
static inline unsigned long get_delta_hdr_size(const unsigned char **datap)
{
const unsigned char *data = *datap;
- unsigned char cmd = *data++;
- unsigned long size = cmd & ~0x80;
- int i = 7;
- while (cmd & 0x80) {
+ unsigned char cmd;
+ unsigned long size = 0;
+ int i = 0;
+ do {
cmd = *data++;
size |= (cmd & ~0x80) << i;
i += 7;
- }
+ } while (cmd & 0x80);
*datap = data;
return size;
}
^ permalink raw reply related [relevance 7%]
Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2006-02-10 18:42 7% [PATCH] delta micro optimization Nicolas Pitre
2006-02-10 20:00 7% ` Junio C Hamano
2006-02-10 20:38 7% ` Nicolas Pitre
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).