unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alan Mackenzie <acm@muc.de>
Cc: kfogel@red-bean.com, emacs-devel@gnu.org
Subject: Re: What have the Romans done for us?  (Bazaar)
Date: Wed, 07 Apr 2010 02:33:53 -0400	[thread overview]
Message-ID: <E1NzOpl-0004gH-Mf@fencepost.gnu.org> (raw)
In-Reply-To: <20100406143144.GB3551@muc.de> (message from Alan Mackenzie on Tue, 6 Apr 2010 14:31:44 +0000)

> Date: Tue, 6 Apr 2010 14:31:44 +0000
> From: Alan Mackenzie <acm@muc.de>
> Cc: emacs-devel@gnu.org
> 
> On Mon, Apr 05, 2010 at 11:32:56AM -0400, Karl Fogel wrote:
> > Alan Mackenzie <acm@muc.de> writes:
> > >Would somebody please remind me of all the advantages Bazaar has over
> > >CVS, all the wonderful things it enables one to do.
> 
> This request is still open.  ;-)

See below, for my humble attempt.  First, some responses to specific
issues.

> Working-tree + repository > working-tree.  There is NO space advantage in
> duplicating the repository over everybody's machines.

The advantage is that you can do VCS operations locally.  I mention
some of them below.

I also hope that the disk space is not the issue, nowadays.  (In any
case, we don't replicate the repository, only part of it --
specifically, only the bound branches you have.  All the other
branches are not on your disk.)

> It's the sluggishness which really bothers me.  Is it decompressing
> which is taking all this time?

No.  It's the network traffic.  Fire up some resource monitoring tool
while you are waiting for "bzr up", and you will see that the CPU is
most of the time idle.  If it were decompressing, it would be visible
in the CPU load.

Another data point: when I do "bzr up" on a machine that is on a very
high-speed connection (in the US), it is much, much faster, as fast as
CVS or faster.

> Always the best sort of question.  :-)
> $ time bzr log -n0 --show-ids > /dev/null
> real    1m42.421s
> user    1m36.229s
> sys     0m2.503s
> 
> $ time bzr log -n0 --show-ids lisp/progmodes/cc-engine.el > /dev/null
> real    0m38.924s
> user    0m38.276s
> sys     0m0.538s
> 
> That is so slow it almost transforms an interactive shell into batch
> mode.

"Doctor, it hurts when I do like this". -- "Well, then don't do that."

Don't use the -n0 switch to "bzr log" unless you really, really,
REALLY have to.  The -n0 switch is very expensive.  I think it causes
bzr to read large portion of the branch's meta-data.  If nothing else,
this defeats the advantage of a warm cache -- which I believe was the
point Andreas was making with his comparative timings.

I found that I almost never need to use -n0.  It is only necessary if
you want to look into changes that came from merged branches.  With
the Emacs almost-linear development on the trunk mainline, it is
unnecessary most of the time.  Without -n0, "bzr log" is _much_
faster, and the warm cache does speed it up considerably.

> > >So, yes, bzr is wonderful, because it's a DISTRIBUTED VCS, and
> > >distributed VCSs are Good Things.  Would somebody please remind me why?
> 
> My question wasn't rhetorical.  ;-)

Let me try to give you my answer.  But first, some personal
philosophical digression:

When you begin using a new non-trivial system, you need to learn to
think according to that system's rules, and use the paradigms
appropriate for that system.  If you try to stick to thinking and
paradigms borrowed from some other system, you will most of the time
be disappointed.

To take a trivial example: if you switch to Lisp from C, you should
learn to "think Lisp".  If you keep "thinking C" and write C programs
in Lisp, you will most probably think that Lisp is ``just a slow, slow
replacement for C'', with awkward syntax and annoying misfeatures
(like the fact that symbols have global scope by default), which just
eats up lots of memory.  Sounds familiar?  Observe:

> > >Right at the moment, it just seems like a slow, slow, slow and buggy
> > >replacement for CVS, which consumes several hundred megabytes of my
> > >disk space more than CVS did.  

So don't "think CVS", "think bzr" instead.  Try to find work patterns
that hit less on bzr's disadvantages and instead make good use of its
advantages.  "bzr up" is slow? do it less often, and instead rely on
local commits for your routine development.  After all, who said
everybody and their dog need to see every feature you develop and
every bug you patch right away?

This means do more work in a local branch and less in the trunk.  bzr
favors this pattern; CVS very much defeated it, so you probably didn't
think about using it as a matter of routine.

Other advantages of bzr that should really change the way you think
about your workflow are that you have all the history locally, and
that branching is very cheap.  That means, if you want to see how
something worked or didn't work in some past version, you can have
that in seconds -- something which would take much longer with CVS,
and therefore not hardwired into our CVS-oriented habits.  It also
means that you can have several local branches, one each for every set
of features you develop, yet another branch for testing crazy ideas
and throwing them away (with a single "bzr revert" command), etc. etc.

One thing that remains to be relatively painful is bootstrapping a
fresh branch.  That is the only "fly in the ointment" of "branching is
cheap" idea.  However, on GNU/Linux a bootstrap is still quite fast,
so perhaps this is not a problem for you.  If it is, explore the
co-located branches features in bzr ("bzr switch" etc.).  Me, I just
have several branches bootstrapped in advance, which I can reuse
whenever I need to.  "bzr pull --overwrite" will make any branch a
copy of the current trunk in a matter of seconds, and almost never
require a bootstrap.  Once I have a fresh branch, I can do there
whatever I like.

The fact that switching between different versions is fast and cheap
means that bisecting to find a change that matters should have much
more place in your routine workflow than it ever could with CVS.

Bottom line, instead of trying to bend bzr and keep your CVS-vintage
habits, "think bzr" and change your habits to fit this new tool.  That
is what I did, and although I'm still far from seeing the end of the
journey (and yes, the quality of bzr docs makes it harder), I do see
improvements in the quality of my life as a developer.

HTH




  parent reply	other threads:[~2010-04-07  6:33 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-05 14:56 What have the Romans done for us? (Bazaar) Alan Mackenzie
2010-04-05 15:32 ` Karl Fogel
2010-04-05 16:08   ` Andreas Schwab
2010-04-05 20:54     ` Karl Fogel
2010-04-05 21:11       ` Andreas Schwab
2010-04-05 21:19         ` Andreas Schwab
2010-04-05 16:40   ` Eli Zaretskii
2010-04-05 19:44     ` Stefan Monnier
2010-04-05 22:01       ` Eli Zaretskii
2010-04-05 20:56     ` Karl Fogel
2010-04-05 19:39   ` Óscar Fuentes
2010-04-06 14:31   ` Alan Mackenzie
2010-04-06 15:24     ` Andreas Schwab
2010-04-06 17:02     ` Chad Brown
2010-04-06 19:50       ` Juri Linkov
2010-04-07  6:33     ` Eli Zaretskii [this message]
2010-04-07 18:47     ` Stephen J. Turnbull
2010-04-05 15:34 ` Eli Zaretskii
2010-04-05 15:43   ` Andreas Schwab
2010-04-05 16:42     ` Eli Zaretskii
2010-04-05 19:52     ` Stefan Monnier
2010-04-06 10:43     ` Richard Stallman
2010-04-07 18:11       ` Stephen J. Turnbull
2010-04-05 16:01 ` Chad Brown
2010-04-05 19:56   ` Stefan Monnier
2010-04-05 23:06     ` chad
2010-04-06  7:14       ` Stephen J. Turnbull
2010-04-05 16:12 ` Chong Yidong
2010-04-06 10:43 ` Richard Stallman
2010-04-06 13:25   ` Alan Mackenzie
2010-04-12  5:04     ` Martin Pool
2010-04-06 14:35 ` Jason Rumney
2010-04-06 16:20   ` Alan Mackenzie
2010-04-07 18:21     ` Stephen J. Turnbull
2010-04-07 20:38 ` Óscar Fuentes

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1NzOpl-0004gH-Mf@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=kfogel@red-bean.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).