From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: [PATCH] pack-objects: emit base before delta.
Date: Thu, 30 Jun 2005 22:58:03 -0700 [thread overview]
Message-ID: <7vbr5nxe38.fsf@assigned-by-dhcp.cox.net> (raw)
This micro-optimizes the order of objects in a pack. By
emitting base objects before deltified ones, unpack-objects do
not keep items on delta_list.
I think it is prudent to keep the add_delta_to_list() logic in
unpack-objects, so this commit only changes the packing side.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
pack-objects.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
9be15981d7038f1d9d0b105f45760987584e60a6
diff --git a/pack-objects.c b/pack-objects.c
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -114,11 +114,13 @@ static unsigned long write_one(struct sh
* if it is written already.
*/
return offset;
- e->offset = offset;
- offset += write_object(f, e);
- /* if we are delitified, write out its base object. */
+
+ /* if we are delitified, write out its base objects first */
if (e->delta)
offset = write_one(f, e->delta, offset);
+
+ e->offset = offset;
+ offset += write_object(f, e);
return offset;
}
------------
next reply other threads:[~2005-07-01 5:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-01 5:58 Junio C Hamano [this message]
2005-07-01 6:18 ` [PATCH] pack-objects: emit base before delta Junio C Hamano
2005-07-01 15:28 ` Linus Torvalds
2005-07-01 15:40 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vbr5nxe38.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox