Skip to contentSkip to conversation

git clone takes ages on a slow link

DISCUSSION Anton Blanchard 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

I tried cloning a local repository when connected over a slow (1 second+ latency) link. It took forever (I gave up after 10 minutes). If I ran it in the background it took a few seconds.

I think the ticker is over anxious.

# git clone -l linux-2.6 linux-2.6-test
0 blocks
Checking files out...
   5% (1060/19552) done			<---- performance bottleneck

Anton

#1 lore raw
Quoted 2 lines · Anton Blanchard

I think the ticker is over anxious.

It is indeed. It's _meant_ to only tick once a second or when the percentage changes, but I think it forgot to clear the "once a second happened" flag, so instead of updates the percentage output for every file it checks out after the first second has passed.

So something like this should help... Can you verify?

Linus
---

builtin-read-tree.c +1 -0
index 716f792..80c9320 100644
@@ -336,6 +336,7 @@ static void check_updates(struct cache_e
 					fprintf(stderr, "%4u%% (%u/%u) done\r",
 						percent, cnt, total);
 					last_percent = percent;
+					progress_update = 0;
 				}
 			}
 		}
#2 lore raw

Hi Linus,

Quoted 6 lines

It is indeed. It's _meant_ to only tick once a second or when the percentage changes, but I think it forgot to clear the "once a second happened" flag, so instead of updates the percentage output for every file it checks out after the first second has passed.

So something like this should help... Can you verify?

Thanks, it fixes it.

Anton

Quoted 12 lines
builtin-read-tree.c +1 -0
index 716f792..80c9320 100644
@@ -336,6 +336,7 @@ static void check_updates(struct cache_e
 					fprintf(stderr, "%4u%% (%u/%u) done\r",
 						percent, cnt, total);
 					last_percent = percent;
+					progress_update = 0;
 				}
 			}
 		}