From: James Westby <jw+debian@jameswestby.net>
To: Teemu Likonen <tlikonen@iki.fi>
Cc: bazaar@lists.canonical.com, emacs-devel@gnu.org
Subject: Re: Emacs repository benchmark: bzr and git
Date: Tue, 18 Mar 2008 20:22:48 +0000 [thread overview]
Message-ID: <1205871768.3304.51.camel@flash> (raw)
In-Reply-To: <20080318154316.GA6242@mithlond.arda.local>
[-- Attachment #1: Type: text/plain, Size: 4587 bytes --]
On Tue, 2008-03-18 at 17:43 +0200, Teemu Likonen wrote:
> 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).
>
Hi,
Thanks for the concrete numbers that we can work from.
So, I hacked up a quick plugin to output logs in a flat style like
git. I've attached it to this mail. You can install it by dropping
it in to ~/.bazaar/plugins.
It is totally unintegrated with bzr's log framework. I plan on
rectifying that and proposing it for inclusion. It also has
some nasty UI warts like using --end revid to limit the
revisions that you want to see to ones that are not that
revid or the parents of it. This means you can't do things
like bzr flatlog -r-100..
I include the numbers from that inline with yours
>
> Viewing history
> ---------------
>
>
> The complete history:
>
> $ time git log >/dev/null
> real 0m5.741s
>
> $ time bzr log >/dev/null
> real 3m15.708s
>
bzr flatlog > /dev/null 45.17s user 0.75s system 97% cpu 46.883 total
>
> Last 100 revisions:
>
> $ time git log -100 >/dev/null
> real 0m0.011s
>
> $ time bzr log -l100 >/dev/null
> real 2m10.270s
>
bzr flatlog -l100 > /dev/null 12.11s user 0.32s system 97% cpu 12.714
total
>
> Last 10 revisions:
>
> $ time git log -10 >/dev/null
> real 0m0.007s
>
> $ time bzr log -l10 >/dev/null
> real 2m9.163s
>
bzr flatlog -l10 > /dev/null 12.18s user 0.25s system 98% cpu 12.582
total
I can also suggest a workaround for anyone that is using bzr and wants
to speed up log further while we work on it.
If you edit ~/.bazaar/bazaar.conf and add
[ALIASES]
flatlog = --end cvs-1:bastien1-20080217010841-op363t09ccs7pais
you can get
bzr flatlog --end cvs-1:bastien1-20080217010841-op363t09ccs7pais
> /dev/null 0.77s user 0.08s system 96% cpu 0.876 total
and still have 1000 revisions to look at.
I'll work on getting -r properly integrated which means you could
have this alias set at all times, and then if you needed full
history you could do
bzr flatlog -r1..
>
> 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
> shared.
bzr creates a second working tree, git replaces your first.
>
>
> 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
to compare getting the second working tree you can use
git clone emacs temp2 1.70s user 1.29s system 31% cpu 9.395 total
(it hardlinks the objects rather than just re-using them as bzr does,
so it's still not the same)
However this is a bit silly, as you are just comparing the usual
ways to get a new branch in that particular VCS.
It is possible to emulate the git way using a couple of bzr commands
if you prefer to work in one directory with one working tree. I don't
have benchmark numbers for that currently though I'm afraid.
>
>
> Create new topic branch based on earlier revision of main development
> branch:
>
> $ time git checkout -b topic master~4 >/dev/null
> real 0m0.085s
>
> $ time bzr branch -r -5 trunk topic >/dev/null
> real 2m51.551s
>
There was a patch proposed a couple of days to tackle an efficiency
operation in exactly this command.
>
>
> 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
>
An inefficiency was also highlighted here a couple of days ago. I think
something was proposed that we could switch this and other commands
to that would speed them up greatly.
If you want to talk about bzr's performance or features I will be happy
to do so, but please drop the emacs list from the discussion.
Thanks,
James
[-- Attachment #2: flatlog.py --]
[-- Type: text/x-python, Size: 6132 bytes --]
from bzrlib import (
branch,
builtins,
commands,
errors,
revision as _mod_revision,
option,
osutils,
)
class cmd_flatlog(commands.Command):
"""Output the log in a flat format."""
takes_options = [
option.Option('limit',
short_name='l',
help='Limit the output to the first N revisions.',
argname='N',
type=builtins._parse_limit,
),
option.Option('start',
type=str,
),
option.Option('end',
type=str,
),
option.Option('timezone',
type=str,
help="Display timezone as local, original or utc",
),
option.Option('forward',
help="Display the revisions from oldest to newest",
),
]
def iter_all_history_topo_sorted(self, repo, revision_id,
limit=None, end=None, no_merges=False):
if revision_id in (None, _mod_revision.NULL_REVISION):
return
if revision_id == end:
return
if limit is not None:
if limit <= 0:
raise errors.BzrCommandError("limit option must be positive")
if limit == 1:
yield revision_id
return
to_process = [revision_id]
indegree = {revision_id:0}
graph = repo.get_graph()
parents_map = {}
no_merge = True
_limit = limit
while to_process:
node = to_process.pop(0)
parent_map = graph.get_parent_map([node])
if node not in parent_map: #ghost
continue
parents = parent_map[node]
parents_map[node] = parents
for parent in parents:
if parent == end:
continue
done = indegree.setdefault(parent, 0)
indegree[parent] += 1
if done == 0:
to_process.append(parent)
to_process = [revision_id]
while to_process:
node = to_process.pop(0)
parents = parents_map[node]
if not no_merges or len(parents) < 2:
yield node
if limit is not None:
limit -= 1
if limit == 0:
return
for parent in parents:
if parent == end or parent is _mod_revision.NULL_REVISION:
continue
if parent in parents_map: #not ghost
indegree[parent] -= 1
if indegree[parent] == 0:
to_process.append(parent)
def iter_all_history_topo_sorted_forward(self, repo,
revision_id, end=None, limit=None, no_merges=False):
if revision_id in (None, _mod_revision.NULL_REVISION):
return
if revision_id == end:
return
if limit is not None:
if limit <= 0:
raise errors.BzrCommandError("limit option must be positive")
to_process = [revision_id]
graph = repo.get_graph()
revs = set()
while to_process:
node = to_process.pop()
parent_map = graph.get_parent_map([node])
if node not in parent_map: #ghost
continue
revs.add(node)
parents = parent_map[node]
for parent in parents:
if parent is not _mod_revision.NULL_REVISION and parent not in revs:
to_process.append(parent)
for rev_id in graph.iter_topo_order(revs):
if no_merges:
parent_map = graph.get_parent_map([node])
if len(parent_map[node]) > 1:
continue
yield rev_id
if limit is not None:
limit -= 1
if limit == 0:
return
def iter_revs(self, repo, start, end, limit, forward, no_merges):
num = 9
i = 0
rev_ids = []
if forward:
rev_generator = self.iter_all_history_topo_sorted_forward(repo,
start, limit=limit, end=end, no_merges=no_merges)
else:
rev_generator = self.iter_all_history_topo_sorted(repo, start,
limit=limit, end=end, no_merges=no_merges)
for rev_id in rev_generator:
rev_ids.append(rev_id)
i += 1
if i == num:
revs = repo.get_revisions(rev_ids)
for rev in revs:
yield rev
i = 0
rev_ids = []
num = min(int(num * 1.5), 200)
revs = repo.get_revisions(rev_ids)
for rev in revs:
yield rev
def run(self, limit=None, start=None, end=None, timezone=None,
forward=False, no_merges=False):
b = branch.Branch.open_containing('.')[0]
if timezone is None:
timezone = "original"
if (start is not None or end is not None) and forward:
raise errors.BzrCommandError("--forward and --start and --end are not supported yet")
repo = b.repository
repo.lock_read()
try:
if start is None:
start = b.last_revision()
for rev in self.iter_revs(repo, start, end, limit, forward, no_merges):
self.outf.write("commit %s\nAuthor: %s\nDate: %s\n\n" % (rev.revision_id,
rev.get_apparent_author(), osutils.format_date(rev.timestamp,
rev.timezone or 0, timezone)))
if not rev.message:
self.outf.write(" (no message)\n")
else:
for l in rev.message.split('\n'):
self.outf.write(" %s\n" % l)
self.outf.write("\n")
finally:
repo.unlock()
commands.register_command(cmd_flatlog)
next prev parent reply other threads:[~2008-03-18 20:22 UTC|newest]
Thread overview: 236+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-12 23:41 Emacs Bazaar repository Jason Earl
2008-03-13 1:48 ` Stefan Monnier
2008-03-13 1:52 ` dhruva
2008-03-13 2:26 ` Bastien
2008-03-13 2:28 ` Stefan Monnier
2008-03-13 3:12 ` dhruva
2008-03-13 4:06 ` Karl Fogel
2008-03-13 4:11 ` Jonathan Lange
2008-03-29 1:00 ` Xavier Maillard
2008-03-13 15:30 ` Karl Fogel
2008-03-13 15:58 ` dhruva
2008-03-13 16:50 ` Jason Earl
2008-03-13 20:18 ` How to spell "commit" [was: bikeshedding bzr (or similar) :] Stephen J. Turnbull
2008-03-13 4:09 ` Emacs Bazaar repository Karl Fogel
2008-03-13 4:15 ` Jonathan Lange
2008-03-13 4:30 ` Jonathan Lange
2008-03-14 1:11 ` Dan Nicolaescu
2008-03-14 1:51 ` Jason Earl
2008-03-14 5:10 ` Jonathan Lange
2008-03-13 9:58 ` Andreas Schwab
2008-03-13 22:13 ` Jonathan Lange
2008-03-14 10:27 ` Andreas Schwab
2008-03-14 10:36 ` David Kastrup
2008-03-13 5:08 ` Jason Earl
2008-03-13 10:39 ` Juanma Barranquero
2008-03-13 14:45 ` Stefan Monnier
2008-03-13 4:19 ` Eric Hanchrow
2008-03-13 5:20 ` Jason Earl
2008-03-13 8:04 ` dhruva
2008-03-13 9:04 ` Thien-Thi Nguyen
2008-03-13 9:41 ` David Kastrup
2008-03-13 12:08 ` Thien-Thi Nguyen
2008-03-13 23:46 ` Jonathan Lange
2008-03-14 2:52 ` dhruva
2008-03-14 3:00 ` Jason Earl
2008-03-14 3:03 ` Martin Pool
2008-03-14 5:36 ` Stephen J. Turnbull
2008-03-14 7:03 ` Martin Pool
2008-03-15 4:44 ` Stephen J. Turnbull
2008-03-14 10:30 ` Andreas Schwab
2008-03-14 15:02 ` Giorgos Keramidas
2008-03-13 11:20 ` James Westby
2008-03-13 16:37 ` Jason Earl
2008-03-13 7:43 ` Thien-Thi Nguyen
2008-03-13 8:49 ` Jason Earl
2008-03-13 9:07 ` Thien-Thi Nguyen
2008-03-13 13:11 ` Aaron Bentley
2008-03-13 11:43 ` Andreas Schwab
2008-03-13 11:55 ` David Kastrup
2008-03-14 9:58 ` Matthieu Moy
2008-03-14 10:42 ` Andreas Schwab
2008-03-14 12:24 ` Matthieu Moy
[not found] ` <8562053f49b38b1584b86e1e4d1ec6e6, vpqbq5htrwx.fsf@bauges.imag.fr>
2008-03-14 12:42 ` David Ingamells
2008-03-14 13:05 ` Andreas Schwab
2008-03-14 12:40 ` Eli Zaretskii
2008-03-14 8:23 ` John Arbash Meinel
2008-03-14 13:32 ` Andreas Schwab
2008-03-14 13:39 ` James Westby
2008-03-14 14:13 ` Matthieu Moy
2008-03-14 14:30 ` Andreas Schwab
2008-03-14 14:37 ` Nicholas Allen
2008-03-14 16:17 ` David Kastrup
2008-03-14 16:32 ` Daniel Mark Watkins
2008-03-14 15:15 ` David Allouche
2008-03-14 15:21 ` James Westby
2008-03-14 15:43 ` Matthieu Moy
2008-03-14 13:35 ` David Kastrup
2008-03-14 13:44 ` James Westby
2008-03-14 13:59 ` David Kastrup
2008-03-14 14:09 ` James Westby
2008-03-14 14:29 ` Nicholas Allen
2008-03-15 0:39 ` Stephen J. Turnbull
2008-03-15 10:30 ` James Westby
2008-03-15 12:30 ` James Westby
2008-03-14 23:34 ` Stephen J. Turnbull
2008-03-17 10:41 ` Matthieu Moy
2008-03-17 12:39 ` Sergei Organov
2008-03-18 1:48 ` Dan Nicolaescu
2008-03-18 2:13 ` dhruva
2008-03-18 4:03 ` Karl Fogel
2008-03-18 5:00 ` dhruva
2008-03-18 5:40 ` Jonathan Lange
2008-03-18 9:17 ` Andreas Schwab
2008-03-18 10:00 ` dhruva
2008-03-19 5:44 ` Bastien
2008-03-19 9:42 ` Juanma Barranquero
2008-03-19 14:04 ` Bastien
2008-03-19 14:49 ` Juanma Barranquero
2008-03-19 15:30 ` Bastien
2008-03-29 1:00 ` Xavier Maillard
2008-03-18 16:50 ` Stefan Monnier
2008-03-18 18:15 ` Juanma Barranquero
2008-03-20 14:00 ` Stefan Monnier
2008-03-20 14:10 ` Jason Rumney
2008-03-20 15:33 ` Stefan Monnier
2008-03-20 20:34 ` Eli Zaretskii
2008-03-21 12:51 ` dhruva
2008-03-29 1:00 ` Xavier Maillard
2008-03-18 19:31 ` Mike Mattie
2008-03-18 19:27 ` Richard Stallman
2008-03-18 20:05 ` Andreas Schwab
2008-03-18 20:26 ` Thien-Thi Nguyen
2008-03-22 4:23 ` Michael Olson
2008-03-22 11:18 ` Thien-Thi Nguyen
2008-03-24 6:19 ` Michael Olson
2008-03-25 9:36 ` Thien-Thi Nguyen
2008-03-20 1:04 ` Jonathan Lange
2008-03-18 20:58 ` Brian Cully
2008-03-18 21:13 ` Mike Mattie
2008-03-18 21:45 ` Stefan Monnier
2008-03-18 22:02 ` Jonathan Lange
2008-03-19 1:21 ` Stefan Monnier
2008-03-18 23:18 ` Chong Yidong
2008-03-18 23:46 ` Nick Roberts
2008-03-19 0:13 ` Thomas Lord
2008-03-19 0:17 ` Mike Mattie
2008-03-19 1:14 ` Thomas Lord
2008-03-19 0:12 ` Johannes Weiner
2008-03-26 7:56 ` David Kastrup
2008-03-27 22:22 ` Johannes Weiner
2008-03-29 1:00 ` Xavier Maillard
2008-03-14 12:56 ` dhruva
2008-03-14 13:10 ` Lennart Borgman (gmail)
2008-03-14 13:23 ` dhruva
2008-03-14 13:26 ` Andreas Schwab
2008-03-14 14:19 ` Matthieu Moy
2008-03-14 14:29 ` Lennart Borgman (gmail)
2008-03-15 0:43 ` Jonathan Rockway
2008-03-15 14:37 ` Eli Zaretskii
2008-03-15 15:06 ` dhruva
2008-03-15 0:44 ` Stephen J. Turnbull
2008-03-17 10:43 ` Matthieu Moy
2008-03-14 22:26 ` Martin Geisler
2008-03-15 12:09 ` dhruva
2008-03-15 21:32 ` Martin Geisler
2008-03-25 21:46 ` Giorgos Keramidas
2008-03-19 10:50 ` Sascha Wilde
2008-03-14 13:03 ` Andreas Schwab
2008-03-14 14:24 ` Matthieu Moy
2008-03-14 14:41 ` Andreas Schwab
2008-03-14 14:46 ` Jelmer Vernooij
2008-03-14 15:15 ` Andreas Schwab
2008-03-15 0:49 ` Harald Meland
2008-03-14 18:04 ` Dan Nicolaescu
2008-03-14 19:42 ` Stefan Monnier
2008-03-14 19:47 ` Andreas Schwab
2008-03-14 20:01 ` Mathias Dahl
2008-03-14 20:06 ` Andreas Schwab
2008-03-14 21:43 ` Karl Fogel
2008-03-15 0:00 ` Stephen J. Turnbull
2008-03-13 20:27 ` Eli Zaretskii
2008-03-14 10:23 ` Andreas Schwab
2008-03-14 3:56 ` Forest Bond
2008-03-14 10:32 ` Andreas Schwab
2008-03-14 11:28 ` Thomas Lord
2008-03-14 22:23 ` Stephen J. Turnbull
2008-03-14 23:49 ` Thomas Lord
2008-03-14 4:52 ` Jonathan Lange
2008-03-14 6:21 ` Dan Nicolaescu
2008-03-14 6:33 ` Alexander Belchenko
2008-03-14 7:16 ` Dan Nicolaescu
2008-03-14 9:18 ` Juanma Barranquero
2008-03-14 10:08 ` Matthew D. Fuller
2008-03-14 10:14 ` Juanma Barranquero
2008-03-19 16:31 ` Nicholas Allen
2008-03-14 10:35 ` Andreas Schwab
2008-03-14 10:37 ` Andreas Schwab
2008-03-14 11:30 ` Matt Nordhoff
2008-03-29 1:00 ` Xavier Maillard
2008-03-13 13:07 ` Andrea Russo
2008-03-14 9:16 ` Nicholas Allen
2008-03-13 14:18 ` Andreas Schwab
2008-03-14 18:08 ` Stefan Monnier
2008-03-14 18:35 ` Jason Earl
2008-03-14 18:51 ` Andreas Schwab
2008-03-14 19:15 ` Stefan Monnier
2008-03-14 19:32 ` Andreas Schwab
2008-03-14 20:12 ` Thomas Lord
2008-03-14 18:31 ` Goffredo Baroncelli
2008-03-16 18:57 ` Stefan Monnier
2008-03-16 19:53 ` Andreas Schwab
2008-03-17 15:00 ` Michael Haggerty
2008-03-17 16:37 ` Andreas Schwab
2008-03-16 21:47 ` Toshio Kuratomi
2008-03-18 15:43 ` Emacs repository benchmark: bzr and git Teemu Likonen
2008-03-18 15:51 ` Lennart Borgman (gmail)
2008-03-18 16:05 ` dhruva
2008-03-19 2:53 ` Richard Stallman
2008-03-27 1:32 ` Jonathan Lange
2008-03-27 2:24 ` Stephen J. Turnbull
2008-03-27 2:55 ` Stefan Monnier
2008-03-27 11:58 ` dhruva
2008-03-27 13:59 ` Vincent Ladeuil
2008-03-29 1:17 ` Stefan Monnier
2008-03-29 1:30 ` James Westby
2008-03-29 3:09 ` Stefan Monnier
2008-03-29 4:06 ` James Westby
2008-03-29 4:50 ` Stefan Monnier
2008-03-29 1:00 ` Xavier Maillard
2008-03-29 4:34 ` David Cournapeau
2008-03-31 0:00 ` Xavier Maillard
2008-03-29 1:00 ` Xavier Maillard
2008-03-29 9:19 ` Andreas Schwab
2008-03-29 9:58 ` David Kastrup
2008-03-29 10:13 ` dhruva
2008-03-29 10:26 ` David Kastrup
2008-03-31 0:00 ` Xavier Maillard
2008-03-29 14:55 ` Randal L. Schwartz
2008-03-29 16:35 ` Óscar Fuentes
2008-03-29 18:13 ` tomas
2008-03-29 21:05 ` Stephen J. Turnbull
2008-03-30 5:49 ` Richard Stallman
2008-03-30 5:49 ` Richard Stallman
2008-03-30 6:25 ` Jonathan Rockway
2008-03-30 19:56 ` Richard Stallman
2008-03-31 0:00 ` Xavier Maillard
2008-03-18 16:19 ` Matthieu Moy
2008-03-19 9:43 ` Teemu Likonen
2008-03-18 16:02 ` Matthieu Moy
2008-03-18 16:33 ` dhruva
2008-03-18 18:41 ` Jonathan Corbet
2008-03-19 1:40 ` dhruva
2008-03-18 21:04 ` Eli Zaretskii
2008-03-18 17:11 ` Teemu Likonen
2008-03-18 17:43 ` Stefan Monnier
2008-03-18 18:20 ` Juanma Barranquero
2008-03-18 16:43 ` Andreas Schwab
2008-03-18 19:19 ` Teemu Likonen
2008-03-18 20:22 ` James Westby [this message]
2008-03-19 11:37 ` Emacs repository benchmark: bzr and git (rerun) Teemu Likonen
2008-03-19 12:17 ` James Westby
2008-03-19 22:39 ` Robert Collins
2008-03-19 16:41 ` Teemu Likonen
2008-03-22 17:59 ` Emacs Bazaar repository Stefan Monnier
2008-03-22 19:59 ` Andreas Schwab
2008-03-24 7:53 ` Christian Faulhammer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1205871768.3304.51.camel@flash \
--to=jw+debian@jameswestby.net \
--cc=bazaar@lists.canonical.com \
--cc=emacs-devel@gnu.org \
--cc=tlikonen@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.