Emacs repository benchmark: bzr and git

Teemu Likonen tlikonen at iki.fi
Tue Mar 18 15:43:16 GMT 2008

I did some benchmarking in git and bzr repositories of Emacs. Some
numbers: 89711 revisions (by "git log --pretty=oneline | wc -l"), 2825
files. Both repositories seem to have just linear history converted from
CVS repo. Both have the same head revision which is
481c2a1e31f32c8aa0fb6d504575b75a18537788 (git) and
revid:cvs-1:tsdh-20080318180244-lxbzttdnh6ecqbka (bzr).

Repositories/branches are pulled from here:
git: git://git.sv.gnu.org/emacs.git
bzr: http://bzr.notengoamigos.org/emacs/trunk/

My system is AMD Sempron 3000+ with 2 GB memory and it's running Debian
GNU/Linux 4.0. I'm using the latest development versions of both git
(1.5.5.rc0.6.gdeda) and bzr (1.4dev). I just measured with 'time'
command how long it takes to run certain commands.

Viewing history

The complete history:

$ time git log >/dev/null
real    0m5.741s

$ time bzr log >/dev/null
real    3m15.708s

Last 100 revisions:

$ time git log -100 >/dev/null
real    0m0.011s

$ time bzr log -l100 >/dev/null
real    2m10.270s

Last 10 revisions:

$ time git log -10 >/dev/null
real    0m0.007s

$ time bzr log -l10 >/dev/null
real    2m9.163s

The complete history of a single file:

$ time git log src/keymap.c >/dev/null
real    0m9.240s
(The same as above but with detecting and following possible renames:)
$ time git log --follow src/keymap.c >/dev/null
real    0m17.891s

$ time bzr log src/keymap.c >/dev/null
real    3m35.431s

Differences between revisions

I'm using exactly the same revisions in both repositories:

revid:cvs-1:wohler-20080318101724-c3ofm3vslli3wfwl  =  -r -5
revid:cvs-1:dann-20080318035819-bwawewmyps2rb2ot    =  -r -11

2635714f3dac5f24eb1997cbf97285810f6799c0  =  HEAD~4
c4d57908d6d8c693e779599182b810565b2eb608  =  HEAD~10

View changes introduced in given revision:

(This shows also the commit message, author and date.)
$ time git show 2635714f3dac5f24eb1997cbf97285810f6799c0 >/dev/null
real    0m0.012s

$ time bzr diff -c revid:cvs-1:wohler-20080318101724-c3ofm3vslli3wfwl >/dev/null
real    2m40.467s

Show differences between two revisions:

$ time git diff HEAD~10..HEAD~4 >/dev/null
real    0m0.076s

$ time bzr diff -r -11..-5 >/dev/null
real    2m44.214s

$ time git diff HEAD~4.. >/dev/null
real    0m0.072s

$ time bzr diff -r -5.. >/dev/null
real    1m21.836s

Creating a branch

With git I chose "git checkout -b" instead of "git branch" because the
former also checks out the files as does "bzr branch". The bzr branch is
created inside the same shared repository so that the common objects are

Create new topic branch based on the head revision of the main
development branch:

$ time git checkout -b topic master >/dev/null
real    0m0.062s

$ time bzr branch trunk topic >/dev/null
real    0m7.249s

Create new topic branch based on earlier revision of main development

$ time git checkout -b topic master~4 >/dev/null
real    0m0.085s

$ time bzr branch -r -5 trunk topic >/dev/null
real    2m51.551s

Compare branches' commit histories

In above benchmark I created branch 'topic' which is based on earlier
revision of main development branch. In this test I compared commands
which display commits that are missing from 'topic' branch compared to
the main development branch (four commits in total).

$ time git log topic..master >/dev/null
real    0m0.006s

$ time bzr missing --theirs-only ../trunk >/dev/null
real    18m25.173s

Annotate/blame a file (src/keymap.c)

$ time git blame src/keymap.c >/dev/null
real    0m8.753s

$ time bzr blame src/keymap.c >/dev/null
real    0m58.296s

More information about the bazaar mailing list