Issue #6 resolved

Push speed issue?

Marko Käning
created an issue

I have here 4 server repos and 4 corresponding local clones.

I had the feeling that pushing changes to bitbucket was unusually slow.

I am actually more used to command line, sometimes used Murky, but have the impression that MacHg seems to have a bottleneck somewhere...

I wonder whether this was accidental or could be checked/measured somehow.

Comments (6)

  1. Jason Harris repo owner

    Hmmm... There shouldn't be any speed issue at all, since MacHg just calls the underlying mercurial command. Look in the MacHg preferences under the tab Advanced and there is a log file location which defaults to: /tmp/MacHgTransactionLog

    Do your push and then see what the corresponding command that MacHg issues. You can try the exact same command on the command line and see the timing. Over and above that there should be very little overhead. As you can see with even a 3.35 Gb repository (my large test repository of mozilla repository) doing a first load on this takes around 5 seconds on my machine. So if you have a normal repository of only some thousands of files and only some thousands of commit messages it should be very fast.

    Thus can you do a strip of the things you pushed to the server and then try pushing again both by command line, the command line which MacHg uses, and "in-application" MacHg push and see if there is any noticeable difference?

    Thanks again!

    Cheers, Jas

  2. Marko Käning reporter

    You are very fast in moving this from proposal to bug! I am fast enough to call it enhancement.


    I guess my delay might have been caused by BB anyways, so I rather think that my bottleneck assumption is nonsense.

    Still it would be good to have the means to somehow measure the throughput.

    And no, my repos have dozens or hundreds of changesets and only so many files, so it is perhaps rather connected with the ssh authentication than anything else. (Can it be that your 3 GB repo is not accessed via ssh?)

  3. Jason Harris repo owner

    Thanks for the feedback!

    It might be an ssh issue... Can you reproduce it from the command line taken out of the MacHgTransactionLog?

    To have MacHg produce the time taken (as a quick workaround) can you search for the following method in MacHg/Classes/General/TaskExecutions.m and change it to the following:

    + (ExecutionResult) executeMercurialWithArgs:(NSMutableArray*)args  fromRoot:(NSString*)rootPath  logging:(LoggingEnum)log  onTask:(NSTask*)theTask
    	ExecutionResult results;
    	if (!rootPath)
    		results.outStr = @"";
    		results.errStr = @"Null root path";
    		results.result = 255;
    		results.generatingCmd  = executableLocationHG();
    		results.generatingArgs = [NSArray arrayWithArray:args];
    		return results;
    	NSMutableArray* newArgs = [self preProcessMercurialCommandArgs:args fromRoot:rootPath];
    	NSString* hgBinary = executableLocationHG();
    	BOOL isPush = NO;
    	if ([[newArgs objectAtIndex:0] isEqualToString:@"push"])
    		[newArgs insertObject:hgBinary atIndex:0];
    		hgBinary = @"/usr/bin/time";
    		log = eIssueErrorsInAlerts;
    		isPush = YES;
    	results = [TaskExecutions synchronouslyExecute:hgBinary withArgs:newArgs onTask:theTask];
    	if (isPush)
    		results.result = 128;
    	[TaskExecutions logAndReportAnyErrors:log forResults:results];
    	return results;

    This will then report the internal speed of the push. If we really want to have logging of speeds then I will think about a more general way to do this. But for now I just want to test this...

    Thanks! Jas

  4. Jason Harris repo owner

    Yeah. My push of the fix for #5 actually took 14 seconds on bit bucket. I tried the same thing to my dreamhost hosted repository and it took 10.8 seconds from within MacHg. I tried the exact same push from the command line and it was 11.795 seconds. So I think MacHg is operating correctly here and its just push is slow... I am going to go ahead and close this. If you can reproduce a difference between command line and MacHg simply reopen it and we will reinvestigate.

    Thanks, Jas

  5. Log in to comment