linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Mercurial 0.4e vs git network pull
@ 2005-05-15 11:22 Adam J. Richter
  2005-05-15 12:40 ` Petr Baudis
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Adam J. Richter @ 2005-05-15 11:22 UTC (permalink / raw)
  To: mpm, pasky; +Cc: git, jgarzik, linux-kernel, mercurial, torvalds

On Sun, 15 May 2005 10:54:05 +0200, Petr Baudis wrote:
>Dear diary, on Thu, May 12, 2005 at 10:57:35PM CEST, I got a letter
>where Matt Mackall <mpm@selenic.com> told me that...
>> Does this need an HTTP request (and round trip) per object? It appears
>> to. That's 2200 requests/round trips for my 800 patch benchmark.

>Yes it does. On the other side, it needs no server-side CGI. But I guess
>it should be pretty easy to write some kind of server-side CGI streamer,
>and it would then easily take just a single HTTP request (telling the
>server the commit ID and receiving back all the objects).

	I don't understand what was wrong with Jeff Garzik's previous
suggestion of using http/1.1 pipelining to coalesce the round trips.
If you're worried about queuing too many http/1.1 requests, the client
could adopt a policy of not having more than a certain number of
requests outstanding or perhaps even making a new http connection
after a certain number of requests to avoid starving other clients
when the number of clients doing one of these transfers exceeds the
number of threads that the http server uses.

	Being able to do without a server side CGI script might
encourage deployment a bit more, both for security reasons and
effort of deployment.

	In any case, using httpd or ftp makes it easier to deploy
servers in cases where it might be harder to modify firewall rules,
so I am glad to see that, even if it is through a CGI script.

                    __     ______________
Adam J. Richter        \ /
adam@yggdrasil.com      | g g d r a s i l

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Mercurial 0.4e vs git network pull
@ 2005-05-15 11:52 Adam J. Richter
  2005-05-15 14:23 ` Petr Baudis
  0 siblings, 1 reply; 26+ messages in thread
From: Adam J. Richter @ 2005-05-15 11:52 UTC (permalink / raw)
  To: pasky; +Cc: git, jgarzik, linux-kernel, mercurial, mpm, torvalds

On Sun, 15 May 2005 14:40:42 +0200, Petr Baudis wrote:
>Dear diary, on Sun, May 15, 2005 at 01:22:19PM CEST, I got a letter
>where "Adam J. Richter" <adam@yggdrasil.com> told me that...
[...]
>> 	I don't understand what was wrong with Jeff Garzik's previous
>> suggestion of using http/1.1 pipelining to coalesce the round trips.
>> If you're worried about queuing too many http/1.1 requests, the client
>> could adopt a policy of not having more than a certain number of
>> requests outstanding or perhaps even making a new http connection
>> after a certain number of requests to avoid starving other clients
>> when the number of clients doing one of these transfers exceeds the
>> number of threads that the http server uses.

>The problem is that to fetch a revision tree, you have to

>	send request for commit A
>	receive commit A
>	look at commit A for list of its parents
>	send request for the parents
>	receive the parents
>	look inside for list of its parents
>	...

>(and same for the trees).

	Don't you usually have a list of many files for which you
want to retrieve this information?  I'd imagine that would usually
suffice to fill the pipeline.

                    __     ______________
Adam J. Richter        \ /
adam@yggdrasil.com      | g g d r a s i l

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Mercurial 0.4e vs git network pull
@ 2005-05-12  9:44 Matt Mackall
  2005-05-12 18:23 ` Petr Baudis
  0 siblings, 1 reply; 26+ messages in thread
From: Matt Mackall @ 2005-05-12  9:44 UTC (permalink / raw)
  To: linux-kernel, git, mercurial, Linus Torvalds

Now that I'm back from vacation, there's a new Mercurial release as
well as snapshots at:

  http://selenic.com/mercurial/

A combined self-hosting repository / web interface can be found at:

  http://selenic.com/hg/

And there's now a mailing list at:

  http://selenic.com/mailman/listinfo/mercurial

The big news is that Mercurial now has a very fast network protocol.
This benchmark is pulling and merging 819 changesets (again, taken
from 2.6.12-rc2-mm3) from one repo to another over DSL using
Mercurial's new delta protocol:

 $ time hg merge hg://selenic.com/linux-hg/
 retrieving changegroup
 merging changesets
 merging manifests
 merging files

 real    0m10.276s
 user    0m3.299s
 sys     0m0.689s

For comparison, rsyncing the same set of changes between git repos from
the same server:

 $ time rsync -a rsync://10.0.0.12:2000/git/lgb/.git .
 sent 171508 bytes  received 31225542 bytes  312408.46 bytes/sec

 real    1m40.470s
 user    0m0.655s
 sys     0m1.896s

The original broken-out.tar.bz2: 2.3M
The same, uncompressed:           15M
The same, rsynced with git:       30M
The same, pulled with hg (zlib): 2.5M  <- what I used above
The same, pulled with hg (bz2):  2.1M

The server in question is a relatively busy 1GHz Athlon. The server
side of the hg protocol is stateless and is serviced by a simple CGI
script run under Apache.

Mercurial is more than 10 times as bandwidth efficient and
considerably more I/O efficient. On the server side, rsync uses about
twice as much CPU time as the Mercurial server and has about 10 times
the I/O and pagecache footprint as well.

Mercurial is also much smarter than rsync at determining what
outstanding changesets exist. Here's an empty pull as a demonstration:

 $ time hg merge hg://selenic.com/linux-hg/
 retrieving changegroup

 real    0m0.363s
 user    0m0.083s
 sys     0m0.007s

That's a single http request and a one line response.

And now with rsync:

 $ time rsync -av rsync://10.0.0.12:2000/git/lgb/.git .
 receiving file list ... done

 sent 76 bytes  received 1280245 bytes  2560642.00 bytes/sec
 total size is 85993841  speedup is 67.17

 real    0m0.539s
 user    0m0.185s
 sys     0m0.148s

Mercurial's communication here scales O(min(changed branches, log new
changesets)) which is less than O(new changesets), while rsync scales
with O(total number of file revisions) (ouch!). The above transfer
size for an empty pull will go from 1.2M to >12M when there's similar
history in git to what's in BK.

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2005-05-16 22:28 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-15 11:22 Mercurial 0.4e vs git network pull Adam J. Richter
2005-05-15 12:40 ` Petr Baudis
2005-05-16 22:22   ` Tristan Wibberley
2005-05-15 17:39 ` Matt Mackall
2005-05-15 18:23   ` Jeff Garzik
2005-05-16  1:12     ` Matt Mackall
2005-05-16  9:29 ` Matthias Urlichs
  -- strict thread matches above, loose matches on Subject: below --
2005-05-15 11:52 Adam J. Richter
2005-05-15 14:23 ` Petr Baudis
2005-05-12  9:44 Matt Mackall
2005-05-12 18:23 ` Petr Baudis
2005-05-12 20:11   ` Matt Mackall
2005-05-12 20:14     ` Petr Baudis
2005-05-12 20:57       ` Matt Mackall
2005-05-12 21:24         ` Daniel Barkalow
2005-05-12 22:29           ` Matt Mackall
2005-05-13  0:33             ` Daniel Barkalow
2005-05-13  1:11               ` Matt Mackall
2005-05-13  2:23                 ` Daniel Barkalow
2005-05-13  2:44                   ` Matt Mackall
2005-05-13  5:44           ` Petr Baudis
2005-05-15  8:54         ` Petr Baudis
2005-05-15  0:40       ` Christian Kujau
2005-05-15  8:50         ` Petr Baudis
2005-05-15 15:12           ` Christian Kujau
2005-05-15  6:22   ` Ingo Molnar

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).