{"thread":{"id":"22674","subject":"[patch] git svn slowness on win32","startedAt":"2010-02-16T10:04:04Z","lastAt":"2010-02-17T23:15:09Z","messageCount":3,"participants":["josh robb","Johannes Schindelin","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"134720","messageId":"13237f021002160204o3c8af7a6i3e7105bd6bc43fa3@mail.gmail.com","threadId":"22674","inReplyTo":null,"subject":"[patch] git svn slowness on win32","fromName":"josh robb","fromEmail":"josh_robb@fastmail.fm","sentAt":"2010-02-16T10:04:04Z","receivedAt":"2010-02-16T10:04:04Z","isPatch":true,"sender":{"key":"josh_robb@fastmail.fm","avatar":null},"body":"Hi,\n\nI'm using git svn (1.6.4.msysgit.0) within a WindowsXP VM running\nunder VMWare fusion on OSX 10.5. For me (and at least one other person\nI know) git svn has been unbearably slow.\n\nMy profiling shows that almost all of the git-svn runtime is being\nspent in DynaLoader (via SVN::Base::import) which I guess is slow in a\nvirtualized windows environment. For example:\n\n$ time perl /libexec/git-core/git-svn rebase\nCurrent branch master is up to date.\n\nreal 2m56.750s\nuser 0m3.129s\nsys 2m39.232s\n\nI've been able to make significant (an order of magnitude)\nimprovements to it's performance by delaying SVN::Base::import from\nrunning until it's actually needed. After making this change:\n\n$ time perl /libexec/git-core/git-svn rebase\nCurrent branch master is up to date.\n\nreal 0m33.407s\nuser 0m1.409s\nsys 0m23.054s\n\ngit svn rebase -n goes from 3m7.046s to 0m10.312s.\n\nWould love to get some feedback/thoughts etc...\n\nj.\n\n\n--- git-svn.orig\tWed Jul 29 22:55:26 2009\n+++ git-svn\tFri Dec  4 13:38:52 2009\n@@ -27,11 +27,13 @@\n $| = 1; # unbuffer STDOUT\n \n sub fatal (@) { print STDERR \"@_\\n\"; exit 1 }\n-require SVN::Core; # use()-ing this causes segfaults for me... *shrug*\n-require SVN::Ra;\n-require SVN::Delta;\n-if ($SVN::Core::VERSION lt '1.1.0') {\n-\tfatal \"Need SVN::Core 1.1.0 or better (got $SVN::Core::VERSION)\";\n+sub _req_svn {\n+\trequire SVN::Core; # use()-ing this causes segfaults for me... *shrug*\n+\trequire SVN::Ra;\n+\trequire SVN::Delta;\n+\tif ($SVN::Core::VERSION lt '1.1.0') {\n+\t\tfatal \"Need SVN::Core 1.1.0 or better (got $SVN::Core::VERSION)\";\n+\t}\n }\n my $can_compress = eval { require Compress::Zlib; 1};\n push @Git::SVN::Ra::ISA, 'SVN::Ra';\n@@ -4379,6 +4381,8 @@\n \tmy ($class, $url) = @_;\n \t$url =~ s!/+$!!;\n \treturn $RA if ($RA && $RA->{url} eq $url);\n+\n+\t::_req_svn();\n \n \tSVN::_Core::svn_config_ensure($config_dir, undef);\n \tmy ($baton, $callbacks) = SVN::Core::auth_open_helper(_auth_providers);\n"},{"id":"134723","messageId":"alpine.DEB.1.00.1002161130590.20986@pacific.mpi-cbg.de","threadId":"22674","inReplyTo":"13237f021002160204o3c8af7a6i3e7105bd6bc43fa3@mail.gmail.com","subject":"Re: [patch] git svn slowness on win32","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2010-02-16T10:34:39Z","receivedAt":"2010-02-16T10:34:39Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 16 Feb 2010, josh robb wrote:\n\n> I'm using git svn (1.6.4.msysgit.0) within a WindowsXP VM running\n> under VMWare fusion on OSX 10.5. For me (and at least one other person\n> I know) git svn has been unbearably slow.\n> \n> My profiling shows that almost all of the git-svn runtime is being\n> spent in DynaLoader (via SVN::Base::import) which I guess is slow in a\n> virtualized windows environment. For example:\n> \n> $ time perl /libexec/git-core/git-svn rebase\n> Current branch master is up to date.\n> \n> real 2m56.750s\n> user 0m3.129s\n> sys 2m39.232s\n> \n> I've been able to make significant (an order of magnitude)\n> improvements to it's performance by delaying SVN::Base::import from\n> running until it's actually needed. After making this change:\n> \n> $ time perl /libexec/git-core/git-svn rebase\n> Current branch master is up to date.\n> \n> real 0m33.407s\n> user 0m1.409s\n> sys 0m23.054s\n> \n> git svn rebase -n goes from 3m7.046s to 0m10.312s.\n> \n> Would love to get some feedback/thoughts etc...\n\nHow about the following commit message (trying to follow \nhttp://repo.or.cz/w/git.git?a=blob;f=Documentation/SubmittingPatches;hb=HEAD):\n\n-- snip --\ngit svn: delay importing SVN::Base until it is needed\n\nImporting functions from a .dll into Git for Windows' perl is pretty slow,\nso let's avoid importing if it is not necessary.\n\n[... timing statistics here...]\n\nSigned-off-by: Josh Robb <josh_robb@fastmail.fm>\n-- snap --\n\nHmm?\n\nCiao,\nDscho\n"},{"id":"134899","messageId":"20100217231509.GA29664@dcvr.yhbt.net","threadId":"22674","inReplyTo":"alpine.DEB.1.00.1002161130590.20986@pacific.mpi-cbg.de","subject":"Re: [patch] git svn slowness on win32","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-02-17T23:15:09Z","receivedAt":"2010-02-17T23:15:09Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n> \n> On Tue, 16 Feb 2010, josh robb wrote:\n> \n> > I'm using git svn (1.6.4.msysgit.0) within a WindowsXP VM running\n> > under VMWare fusion on OSX 10.5. For me (and at least one other person\n> > I know) git svn has been unbearably slow.\n> > \n> > My profiling shows that almost all of the git-svn runtime is being\n> > spent in DynaLoader (via SVN::Base::import) which I guess is slow in a\n> > virtualized windows environment. For example:\n> > \n> > $ time perl /libexec/git-core/git-svn rebase\n> > Current branch master is up to date.\n> > \n> > real 2m56.750s\n> > user 0m3.129s\n> > sys 2m39.232s\n> > \n> > I've been able to make significant (an order of magnitude)\n> > improvements to it's performance by delaying SVN::Base::import from\n> > running until it's actually needed. After making this change:\n> > \n> > $ time perl /libexec/git-core/git-svn rebase\n> > Current branch master is up to date.\n> > \n> > real 0m33.407s\n> > user 0m1.409s\n> > sys 0m23.054s\n> > \n> > git svn rebase -n goes from 3m7.046s to 0m10.312s.\n> > \n> > Would love to get some feedback/thoughts etc...\n> \n> How about the following commit message (trying to follow \n> http://repo.or.cz/w/git.git?a=blob;f=Documentation/SubmittingPatches;hb=HEAD):\n> \n> -- snip --\n> git svn: delay importing SVN::Base until it is needed\n> \n> Importing functions from a .dll into Git for Windows' perl is pretty slow,\n> so let's avoid importing if it is not necessary.\n> \n> [... timing statistics here...]\n> \n> Signed-off-by: Josh Robb <josh_robb@fastmail.fm>\n> -- snap --\n\nHi Josh,\n\nYour patch was missing a call to ::req_svn() in cmd_branch(), but\notherwise it appears fine and passes all tests.\n\nCan you write a proper commit message + patch so we can apply\nit cleanly as Johannes suggested?  Thanks!\n\n(full diff below)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 473a0b9..224c29f 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -36,11 +36,13 @@ $ENV{TZ} = 'UTC';\n $| = 1; # unbuffer STDOUT\n \n sub fatal (@) { print STDERR \"@_\\n\"; exit 1 }\n-require SVN::Core; # use()-ing this causes segfaults for me... *shrug*\n-require SVN::Ra;\n-require SVN::Delta;\n-if ($SVN::Core::VERSION lt '1.1.0') {\n-\tfatal \"Need SVN::Core 1.1.0 or better (got $SVN::Core::VERSION)\";\n+sub _req_svn {\n+\trequire SVN::Core; # use()-ing this causes segfaults for me... *shrug*\n+\trequire SVN::Ra;\n+\trequire SVN::Delta;\n+\tif ($SVN::Core::VERSION lt '1.1.0') {\n+\t\tfatal \"Need SVN::Core 1.1.0 or better (got $SVN::Core::VERSION)\";\n+\t}\n }\n my $can_compress = eval { require Compress::Zlib; 1};\n push @Git::SVN::Ra::ISA, 'SVN::Ra';\n@@ -730,6 +732,7 @@ sub cmd_branch {\n \t\t$src=~s/^http:/https:/;\n \t}\n \n+\t::_req_svn();\n \tmy $ctx = SVN::Client->new(\n \t\tauth    => Git::SVN::Ra::_auth_providers(),\n \t\tlog_msg => sub {\n@@ -4859,6 +4862,8 @@ sub new {\n \t$url =~ s!/+$!!;\n \treturn $RA if ($RA && $RA->{url} eq $url);\n \n+\t::_req_svn();\n+\n \tSVN::_Core::svn_config_ensure($config_dir, undef);\n \tmy ($baton, $callbacks) = SVN::Core::auth_open_helper(_auth_providers);\n \tmy $config = SVN::Core::config_get_config($config_dir);\n\n-- \nEric Wong\n"}]}