Mercurial vs. Bazaar speedtest clone and log (unscientific)

I just did a test with the provided Python 2.x repos from the DVCS PEP for Python to check the performance of Bazaar and Mercurial.

(this is a slightly changed version of a mail posted to the mercurial list: http://selenic.com/pipermail/mercurial/2008-November/022199.html )

All these tests are done only once with some mostly constant load, so they don't qualitfy as scientific tests, but they give a good impressing of the differences between Bazaar (bzr) and Mercurial (hg).

Versions:
- Bazaar 1.5
- Mercurial 1.0.2

These are the ones which are marked as stable in my Gentoo tree (amd64).


First test: initial cloning from the web.

With repositories containing the same changesets (roughly, since bzr tracks dir name changes) Mercurial is about 9 times faster than Bazaar.

$ time bzr branch http://code.python.org/python/trunk
No handlers could be found for logger "bzr"
[13868] 2008-11-05 11:36:44.358 INFO: Branched 40626 revision(s).
Branched 40626 revision(s).

real 24m0.446s
user 12m47.623s
sys 0m15.842s

$ time hg clone http://code.python.org/hg/trunk/ python-hg-trunk
requesting all changes
adding changesets
adding manifests
adding file changes
added 40556 changesets with 86253 changes to 8166 files
updating working directory
3922 files updated, 0 files merged, 0 files removed, 0 files unresolved

real 2m40.237s
user 1m34.721s
sys 0m13.027s

>>> (24.0 + 0.44 / 60 ) / ( 2 + 40.237 / 60 )
8.989434400294563


And hg only uses about half as much space as bzr for the repository data (with bzr 1.5 that is - that was the stable version in my Gentoo tree as of 2008-10-31):

$ du -hs python-bzr-trunk/.bzr python-hg-trunk/.hg
214M python-bzr-trunk/.bzr
111M python-hg-trunk/.hg


Second test: a full log.

A full bzr log takes about 2.5 times as long as a full hg log in the cloned python 2.x repositories (so hg log is about 2.5 times faster than bzr log):

$ time bzr log
...
real 1m10.258s
user 0m37.236s
sys 0m2.250s

$ time hg log
...
real 0m27.886s
user 0m12.737s
sys 0m0.482s

>>> (1 + 10.258/60) / (27.886 / 60)
2.519472136555978

As I understand it, the new revlog in C should give Mercurial another nice speedup here (am I right in that?).


Third test: local clones.

A local clone in Mercurial is about 11 times faster than a local clone in bzr.

$ time bzr branch python-bzr-trunk/ python-bzr-trunk2
...
real 11m36.265s
user 8m38.400s
sys 0m11.145s

$ time hg clone python-hg-trunk python-hg-trunk2
...
real 0m59.759s
user 0m23.321s
sys 0m5.455s

 

A second run (backwards, with hot filesystem caches) gave even stronger results:
$ rm -r clone python-hg-trunk
$ time hg clone python-hg-trunk2 python-hg-trunk
real 0m38.779s
user 0m23.394s
sys 0m4.635s

With bzr I first cloned backwards to heat up the filesystem caches and then cloned again:
$ rm -r python-bzr-trunk
$ bzr branch python-bzr-trunk2 python-bzr-trunk
$ rm -r python-bzr-trunk2
$ time bzr branch python-bzr-trunk python-bzr-trunk2
...
real 12m8.374s
user 8m44.747s
sys 0m10.782s

Result: bzr is unusable for quick local clones of not-so-small projects.


Sidenote:
$ #cold copy of .hg
$ time cp -r python-hg-trunk/.hg tmp-hg
real 0m53.981s
user 0m0.077s
sys 0m3.486s

# hot copy of .bzr
$ time cp -r python-bzr-trunk/.bzr tmp-bzr
real 0m25.738s
user 0m0.012s
sys 0m1.368s

# hot copy of .hg
$ rm -r tmp-hg
$ time cp -r python-hg-trunk/.hg tmp-hg
real 0m14.702s
user 0m0.085s
sys 0m6.241s


To alleviate some doubts about system load: this is what top gave while I did the first local clone of the bzr repo:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
23202 arne 21 1 359m 255m 3412 R 70.1 12.7 1:39.33 bzr

CPU load due to bzr moved between 60% and 80% while cloning.

The general load on the system while running bzr commands was about the same as while running hg commands (I compiled stuff with niceness 11 = low priority).


Result: So Mercurial is far faster than bzr, while being a lot more newbie friendly than git (especially when the newbies are former svn users - Python currently uses svn).

Inhalt abgleichen
Willkommen im Weltenwald!
((λ()'Dr.ArneBab))



Beliebte Inhalte

sn.1w6.org news

Kommunikation im Internet ist in Gefahr!

Liebe Besucher,
leider müssen wir euch kurz unterbrechen:

Das EU-Parlament stimmt nächste Woche über eine Urheberrechtsreform ab,
die alle kleinen Kommunikationsplattformen in ihrer Existenz bedroht.

Offener Brief der Forenbetreiber

Wir bitten euch daher darum, dass ihr

Vielen Dank für eure Unterstützung!

Euer Draketo

Wir sind Teil des #321EUOfflineDay