git-bundle create on cygwin was nearly unusable due to 1 character
at a time (unbuffered) reading from an exec'ed process. Fix by using
fdopen to get a buffered stream.
Results for "time git bundle create test.bdl v1.0.3..v1.5.2" are:
before this patch:
cygwin linux
real 1m38.828s 0m3.578s
user 0m12.122s 0m2.896s
sys 1m28.215s 0m0.692s
after this patch:
real 0m3.688s 0m2.835s
user 0m3.075s 0m2.731s
sys 0m1.075s 0m0.149s
Signed-off-by: Mark Levedahl <mdl123@verizon.net>
---
builtin-bundle.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/builtin-bundle.c b/builtin-bundle.c
index 2d0e106..b954213 100644
--- a/builtin-bundle.c
+++ b/builtin-bundle.c
@@ -207,6 +207,7 @@ static int create_bundle(struct bundle_header *header, const char *path,
char buffer[1024];
struct rev_info revs;
struct child_process rls;
+ FILE *rls_fout;
/*
* NEEDSWORK: this should use something like lock-file
@@ -236,10 +237,11 @@ static int create_bundle(struct bundle_header *header, const char *path,
rls.git_cmd = 1;
if (start_command(&rls))
return -1;
- while ((i = read_string(rls.out, buffer, sizeof(buffer))) > 0) {
+ rls_fout = fdopen(rls.out, "r");
+ while (fgets(buffer, sizeof(buffer), rls_fout)) {
unsigned char sha1[20];
if (buffer[0] == '-') {
- write_or_die(bundle_fd, buffer, i);
+ write_or_die(bundle_fd, buffer, strlen(buffer));
if (!get_sha1_hex(buffer + 1, sha1)) {
struct object *object = parse_object(sha1);
object->flags |= UNINTERESTING;
@@ -250,6 +252,7 @@ static int create_bundle(struct bundle_header *header, const char *path,
object->flags |= SHOWN;
}
}
+ fclose(rls_fout);
if (finish_command(&rls))
return error("rev-list died");
--
1.5.3.rc4.53.g9fc90
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Dmitry Torokhov | 2.6.27-rc8+ - first impressions |
| Greg KH | [patch 00/28] 2.6.25-stable review |
| Linus Torvalds | Linux 2.6.27-rc8 |
| Jan Kundrát | kswapd high CPU usage with no swap |
git: | |
| Ken Pratt | pack operation is thrashing my server |
| ir0s | Local branch ahead of tracked remote branch but git push claims everything up-to-d... |
| Wink Saville | Resolving conflicts |
| Olivier Marin | [PATCH] builtin-rerere: fix conflict markers parsing |
| Samuel Moñux | Cyrus IMAP performance problems [Long] |
| Richard Stallman | Real men don't attack straw men |
| Didier Wiroth | how can I "find xyz | xargs tar" ... like gtar |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Volker Armin Hemmann | build error with 2.6.27.6+reiser4+ehci-hub patch. ERROR: "mii_ethtool_gset" [drive... |
| Frithjof Hammer | Re: [LARTC] ifb and ppp |
| David Miller | [GIT]: Networking |
| David Madore | atl1e Ethernet driver not seeing packets sent to 33:33:00:00:00:01 multicast |
| Block Sub System query | 2 hours ago | Linux kernel |
| kernel module to intercept socket creation | 3 hours ago | Linux kernel |
| Image size changing during each build | 3 hours ago | Linux kernel |
| Soft lock bug | 8 hours ago | Linux kernel |
| sysctl - dynamic registration problem | 14 hours ago | Linux kernel |
| Question on swap as ramdisk partition | 17 hours ago | Linux kernel |
| serial driver xmit problem | 21 hours ago | Linux kernel |
| Generic Netlink subsytem | 22 hours ago | Linux kernel |
| 'Report spam filter error' page broken | 1 day ago | KernelTrap Suggestions and Feedback |
| Netfilter kernel module | 1 day ago | Linux kernel |
