From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: [PATCH 5/4] Minimum fixups to cache-tree
Date: Sun, 23 Apr 2006 20:03:27 -0700 [thread overview]
Message-ID: <7v8xpvd69s.fsf_-_@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vodyrdas9.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Sun, 23 Apr 2006 18:25:58 -0700")
The first hunk is the repeat of the previous "oops". The second
is a real fix.
With this applied, 100-patch series (going from present to past
at the Linux 2.6 kernel tip) applies correctly with the
following stats:
Trying w/o the patch...
24.57user 4.48system 0:34.47elapsed 84%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+322156minor)pagefaults 0swaps
Trying w/ the patch...
15.81user 3.00system 0:20.84elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+252063minor)pagefaults 0swaps
So there definitely is an improvement. *Grin*.
The script used to bench this is attached at the end. "linus" is the tracking
branch and currently it points at v2.6.17-rc2-g6b426e7
$HOME/git-master/bin is where I installed the "master" version,
and $J (aka ../git.junio/) is the freshly compiled area with the
patch series applied (all five of four ;-).
-- >8 --
Minimum fixups to make things usable.
---
diff --git a/apply.c b/apply.c
index 5fa2c1e..e283df3 100644
--- a/apply.c
+++ b/apply.c
@@ -1935,8 +1935,6 @@ static int apply_patch(int fd, const cha
active_cache_sha1) ||
commit_index_file(&cache_file))
die("Unable to write new cachefile");
- cache_tree_update(active_cache_tree,
- active_cache, active_nr, 1);
write_cache_tree(active_cache_sha1, active_cache_tree);
}
diff --git a/cache-tree.c b/cache-tree.c
index 4dbdb65..f6d1dd1 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -348,10 +348,7 @@ #endif
}
for (i = 0; i < it->subtree_nr; i++) {
struct cache_tree_sub *down = it->down[i];
- int len = pathlen + down->namelen;
- memcpy(path + pathlen, down->name, down->namelen);
- path[len] = '/';
- buffer = write_one(down->cache_tree, path, len+1,
+ buffer = write_one(down->cache_tree, down->name, down->namelen,
buffer, size, offset);
}
return buffer;
--
#!/bin/sh
J=../git.junio
M=$HOME/git-master/bin
export J M
git reset --hard linus
previous=
git rev-list -n 100 HEAD |
while read commit
do
if test -n "$previous"
then
git-diff-tree -p "$previous" "$commit" >"$commit-$previous"
echo "$commit $previous"
fi
previous="$commit"
done >series
git reset --hard linus
echo "Trying w/o the patch..."
/usr/bin/time sh -c '
while read commit previous
do
$M/git-apply --whitespace=nowarn --index "$commit-$previous"
$M/git-write-tree
done <series
' >out-1
tree1=`git write-tree`
git reset --hard linus
echo "Trying w/ the patch..."
$J/git-write-tree
/usr/bin/time sh -c '
while read commit previous
do
$J/git-apply --whitespace=nowarn --index "$commit-$previous"
$J/git-write-tree
done <series
' >out-2
tree2=`git write-tree`
test "$tree1" = "$tree2" || exit 1
cmp out-1 out-2
next prev parent reply other threads:[~2006-04-24 3:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-23 23:52 [PATCH 4/4] Invalidate cache-tree entries for touched paths in git-apply Junio C Hamano
2006-04-24 1:25 ` Junio C Hamano
2006-04-24 2:47 ` Junio C Hamano
2006-04-24 3:03 ` Junio C Hamano [this message]
2006-04-24 5:41 ` 50% speed-up of "git-apply && git-write-tree" sequence Junio C Hamano
2006-04-24 21:31 ` maintenance of cache-tree data Junio C Hamano
2006-04-24 22:34 ` Junio C Hamano
2006-04-25 23:05 ` 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=7v8xpvd69s.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;
as well as URLs for NNTP newsgroup(s).