git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Miller <jason@milr.com>
To: John Kristian <jkristian@linkedin.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: git-svn with big subversion repository
Date: Tue, 8 Mar 2011 21:53:42 -0800	[thread overview]
Message-ID: <20110308215342.35b8aac1@naru.jasonmmiller.org> (raw)
In-Reply-To: <C992EE5B.CBFB%jkristian@linkedin.com>

On Wed, 2 Mar 2011 02:43:23 +0000
John Kristian <jkristian@linkedin.com> wrote:

> How do you recommend using git to work with branches of a large, busy
> subversion repository? In general, how can small teams use git for
> their tasks, and use subversion to coordinate with a larger
> organization?

I don't know if this is the same problem that you are having, but...

I had to clone a repository with 200k revisions and 12000
branches+tags.  It was going to take weeks and weeks with a local
svnsync mirror on a high-end workstation with fast disks.

I've never touched perl-code previous to this, but a friend pointed me
at a good perl profiler, and I found pretty quickly the offending line
of code in git-svn:

3515         return unless ::verify_ref($self->refname.'^0');

This was basically doing a
  system("git rev-parse --verify some-reference^0")

several times per revision fetched per branch.  When you have 12000
branches, that really, really adds up.  I made a change that seems to
speed it up by a factor of about 10-20x on my repository, but I'm still
digging around in git to see if I'm doing it correctly.

My basic logic is that if the above one-liner returns true then either
one of the following files will exist:
    $ENV{GIT_DIR}/refs/remotes/$refname
    $ENV{GIT_DIR}/refs/$refname
    $ENV{GIT_DIR}/refs/heads/$refname
or there will be an entry for the reference in
    $ENV{GIT_DIR}/packed-refs

Furthermore since packed-refs changes infrequently, you can cache its
contents.

I'm still digging around in the plumbing to see if this is
assumption is true or not.  If I find it is true, I'll likely submit a
patch.  Now that it "works on my machine" I've backburnered it a bit
since git is more a tool I use than a project I hack on.

-Jason

  parent reply	other threads:[~2011-03-09  6:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02  2:43 git-svn with big subversion repository John Kristian
2011-03-02 16:09 ` Thomas Ferris Nicolaisen
2011-03-03  4:13 ` Phil Hord
2011-03-05 10:53 ` Florian Weimer
2011-03-09  5:53 ` Jason Miller [this message]
     [not found]   ` <C99D031D.D0D9%jkristian@linkedin.com>
2011-03-11  0:32     ` Jason Miller

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=20110308215342.35b8aac1@naru.jasonmmiller.org \
    --to=jason@milr.com \
    --cc=git@vger.kernel.org \
    --cc=jkristian@linkedin.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.
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).