You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stefan Fuhrmann <st...@alice-dsl.de> on 2009/03/01 15:29:16 UTC

Performance regression with reverse merge

Hi devs,

while giving TSVN 1.6. some final touches, I ran into this one:
I just wanted to 'undo' (reverse-merge) a small, fairly recent
revision but it would TSVN over 10 minutes to complete.

Because this is a major performance issue IMHO, I tried to 
reproduce it on my LINUX box - sadly with success. This is
what I found:

Server info: 
  username: guest
  empty password
  Powered by Subversion version 1.5.1 (r32289)

$ uname -a
Linux opti 2.6.24-23-generic #1 SMP Mon Jan 26 00:13:11 UTC 2009 i686 GNU/Linux
$ svn --version
svn, version 1.4.6 (r28521)
<snip>
$ svn co http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk -r15533 ~/TSVN > /dev/null
$ time svn diff -r 15456:15455 http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk > /dev/null

real	0m12.496s
user	0m0.016s
sys	0m0.008s
$ time svn merge -r 15456:15455 http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN
U    TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp
U    TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h

real	0m15.732s
user	0m0.044s
sys	0m0.016s

This is already quite bad but it gets much worse:

$ cd ~/Documents/subversion-1.6.0-rc3/subversion/svn
$ ./svn --version
svn, version 1.6.0 (Release Candidate 3)
<snip>
$ ./svn co http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk -r15533 ~/TSVN2 > /dev/null
$ time ./svn diff -r 15456:15455 http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk > /dev/null

real	0m11.207s
user	0m0.028s
sys	0m0.048s
$ time ./svn merge -r 15456:15455 http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN2
--- Reverse-merging r15456 into '/home/stefan/TSVN2/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp':
U    /home/stefan/TSVN2/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp
--- Reverse-merging r15456 into '/home/stefan/TSVN2/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h':
U    /home/stefan/TSVN2/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h

real	6m51.248s
user	0m2.292s
sys	0m0.656s

Hopefully, someone can fix that or at least qualify the
issue in 1.6.0.

-- Stefan^2.


Re: Performance regression with reverse merge

Posted by Stefan Fuhrmann <st...@alice-dsl.de>.
On Sunday 01 March 2009 19:02:24 you wrote:
> Here is the 1.5.6 merge timing:
>
> $ time svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN
> --- Reverse-merging r15456 into
> '/home/mphippard/TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp':
> U   
> /home/mphippard/TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp
> --- Reverse-merging r15456 into
> '/home/mphippard/TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h':
> U    /home/mphippard/TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h
>
> real	0m40.362s
> user	0m1.289s
> sys	0m0.946s
>
> As a reminder, this is what it was for 1.6 RC2:
>
>  real    1m13.431s
>  user    0m1.899s
>  sys     0m1.507s
>
> So it is slower for sure.  I'd guess the difference is even worse when
> the network is slower.
>
> Does the tree conflicts work possibly introduce some new checking and
> network turnarounds?

In both cases, 1.6 and 1.5, the client is constantly
talking to the server and vice versa: I see a constant
flow of 4kB/s in and 4kB/s out.

Your numbers are exceptionally good because you
are close to the server. My ping to tortoisesvn.tigris.org
is a pretty constant 187 ms.

And here my numbers again:

version	user+sys	real		
1.4.6	0.060s	15.7s
1.5.6	2.784s	352.2s
1.6.0RC3	2.948s	351.2s

In 1.4.6, most of the runtime seems to be the in diff 
routine (~12s). Because your numbers (~1s) are much
better, I assume that SVN needs already 50+ network 
round-trips. That seems unnecessary.

Later versions just seem to make worse by a factor
of 20+. Since TSVN is a rather small project, other
projects may be hurt much more as soon as they are
globally dispersed.

It seems that the client sends merge info (or similar
data) for every item in the working copy (or larger
parts of it). When I restrict the merge to small sub-tree,
the results are:

$ time ./svn merge -r 15456:15455  
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk/src/TortoiseProc/RevisionGraph  
~/TSVN4
--- Reverse-merging r15456 into '/home/stefan/TSVN4/RevisionGraphDlg.cpp':
U    /home/stefan/TSVN4/RevisionGraphDlg.cpp
--- Reverse-merging r15456 into '/home/stefan/TSVN4/RevisionGraphDlg.h':
U    /home/stefan/TSVN4/RevisionGraphDlg.h

real	1m1.306s
user	0m0.180s
sys	0m0.144s

-- Stefan^2.



Re: Performance regression with reverse merge

Posted by Mark Phippard <ma...@gmail.com>.
On Sun, Mar 1, 2009 at 10:29 AM, Stefan Fuhrmann
<st...@alice-dsl.de> wrote:
> Hi devs,
>
> while giving TSVN 1.6. some final touches, I ran into this one:
> I just wanted to 'undo' (reverse-merge) a small, fairly recent
> revision but it would TSVN over 10 minutes to complete.
>
> Because this is a major performance issue IMHO, I tried to
> reproduce it on my LINUX box - sadly with success. This is
> what I found:
>
> Server info:
>  username: guest
>  empty password
>  Powered by Subversion version 1.5.1 (r32289)
>
> $ uname -a
> Linux opti 2.6.24-23-generic #1 SMP Mon Jan 26 00:13:11 UTC 2009 i686 GNU/Linux
> $ svn --version
> svn, version 1.4.6 (r28521)

Since you are calling this a 1.6 regression, why are you not comparing
against 1.5.6?

> <snip>
> $ svn co http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk -r15533 ~/TSVN > /dev/null

You might have mentioned how long it takes this checkout to run?  I am
running checkout from a box in the CollabNet network and it is still
taking forever.

> $ time svn diff -r 15456:15455 http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk > /dev/null

On Windows, with 1.6.0 RC2 on a box in CollabNet network, this
finished in less than a second.

I need checkout to finish to run the rest.  I will update you when I do.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1251415


Re: Performance regression with reverse merge

Posted by Paul Burba <pt...@gmail.com>.
On Sun, Mar 8, 2009 at 12:44 PM, Stefan Fuhrmann
<st...@alice-dsl.de> wrote:
> Paul Burba wrote:
>> Stefan Fuhrmann wrote:
>> >> > Paul Burba wrote:
>> >> >> but it does tell
>> >> >> us something we already knew: A significant part of merge's slowdown
>> >> >> in 1.5.0+ is due to the need to walk the working copy looking for
>> >> >> explicit subtree mergeinfo.  This is not something we can skip for
>> >> >> mergeinfo aware merges, we need to know about these subtrees.  Though
>> >> >> the ongoing WCNG work will probably make it a *lot* faster.
>> >> >
>> >> > Hm. Looking at the measured data tells a different story:
>> >> > the client is responsible for less than 1% of the runtime
>> >> > (<3s of 350s total). The very constant flow of data between
>> >> > client and server is an indication for a similar situation on
>> >> > the server.
>>
>> Hi Stefan,
>>
>> When I said "make it a *lot* faster" the "it" I was referring to was
>> the time to perform the walk to find all the subtree mergeinfo.  In my
>> testing the time spent doing the walk for subtree mergeinfo was
>> approximately 3 minutes of the 9 minute merge -- hence "a significant
>> part of merge's slowdown" (at least for me! YMMV).
>
> Perhaps we are missing each others point. I don't question
> that the WC walk accounts for a major part of the run-time.
>
> However, neither disk I/O nor CPU is used more but marginally
> during that time. It is the network I/O that sees a constant trickle
> of small packages (4k in, 4k out per second). My conclusion is
> that during the WC walk, the client spends most time waiting
> for the server.
>
> Unless the number of C/S interaction is reduced by the WCNG
> design, I expect no significant performance improvement.
>
>> >> > That means, the most time is spent on the network with
>> >> > 1500 .. 2000 roundtrips (given a 187ms ping). So, you are
>> >> > right that the whole WC is crawled for mergeinfo. But the
>> >> > real problem is that for every 'relevant' node, there is an
>> >> > individual communication with the server. A faster WC
>> >> > implementation alone will have no effect here.
>>
>> Agreed, but again, for me the crawl is a significant chunk of time.
>>
>> > IMHO, there are two approaches to speeding things up:
>> >
>> > * stream / interleave C/S communication
>> >  (would serf be of any help here?)
>>
>> It seems so yes.  Could you try the merge with serf and see what you
>> find?  I saw a pretty dramatic improvement using serf over neon:
>>
>> 1.6.0.RC3.RA_NEON>C:\SVN\TSVN>timethis svn merge -r 15456:15455
>> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
>>
>> TimeThis :  Command Line :  svn merge -r 15456:15455
>> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
>> TimeThis :    Start Time :  Wed Mar 04 10:02:29 2009
>>
>> --- Reverse-merging r15456 into
>> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
>> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
>> --- Reverse-merging r15456 into
>> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
>> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h
>>
>> TimeThis :  Command Line :  svn merge -r 15456:15455
>> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
>> TimeThis :    Start Time :  Wed Mar 04 10:02:29 2009
>> TimeThis :      End Time :  Wed Mar 04 10:11:36 2009
>> TimeThis :  Elapsed Time :  00:09:07.140
>>
>> 1.6.0.RC3.RA_SERF>C:\SVN\TSVN>timethis svn merge -r 15456:15455
>> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
>>
>> TimeThis :  Command Line :  svn merge -r 15456:15455
>> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
>> TimeThis :    Start Time :  Wed Mar 04 10:12:32 2009
>>
>> --- Reverse-merging r15456 into
>> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
>> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
>> --- Reverse-merging r15456 into
>> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
>> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h
>>
>> TimeThis :  Command Line :  svn merge -r 15456:15455
>> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
>> TimeThis :    Start Time :  Wed Mar 04 10:12:32 2009
>> TimeThis :      End Time :  Wed Mar 04 10:16:36 2009
>> TimeThis :  Elapsed Time :  00:04:04.421
>>
>> Still pokey, but it's something.  And as I said, for me almost 3
>> minutes of this time is spent walking to target tree looking for
>> mergeinfo.  WCNG should drop that to a fraction of the time, so then
>> we could be looking at about a minute.

Doh, sorry, I was mistaken, the walk for me is closer to one minute, not three!

> Here we go (SVN 1.6.0-RC3, i686 LINUX):
>
> $time ./svn co http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN -r
> 15533 --ignore-externals > /dev/null
>
>        serf            neon
> real    2m41.073s       2m15.268s
> user    0m54.107s       0m6.840s
> sys     1m25.297s       0m3.672s
>
> $time ./svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN
>
>        serf            neon
> real    5m29.002s       6m43.831s
> user    0m1.992s        0m2.124s
> sys     0m0.824s        0m0.664s
>
> Hm. Merge is 20% faster over Serf but c/o is 20% slower.
> More importantly, c/o is CPU-bound with Serf!
> That is really unexpected.

Hmmmm, that is unexpected.

>> Beyond that, improvements are going to be harder to come by in this
>> example because http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
>> has so much explicit subtree mergeinfo, *226* paths in fact!  I assume
>> this is what you are referring to as "every 'relevant' node".  Do you
>> know how all of this mergeinfo came about?  Do you do 'subtree
>> merges'? (i.e. a merge directly targeting a subtree of a branch rather
>> than its root).
>
> TSVN developers use SVN close to HEAD. It seems
> that most of this merge info was added during 1.5
> development (around Oct 2007), i.e. the result
> of alpha-quality code.
>
> From what I can tell, most of that merge info can
> be deleted because they refer to revision that did
> not change the source node. Is it safe to do that or
> will I screw up the current merge tracking logic?

It really depends on what the subtree mergeinfo is overriding (i.e.
what would the path inherit for mergeinfo if it had no mergeinfo of
its own).  Most of subtree mergeinfo on
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk is coming from the
'/branches/1.4.x/' and '/branches/LogCacheEnhancement' branches.
Assuming you won't be merging from those branches to trunk (directly
or from copies of those branches) then I am quite confident you can
safely delete the mergeinfo from those subtrees.  In fact, I think a
lot of this mergeinfo would have elided away a long time ago, but for
the fact that there are some path differences between the mergeinfo
path and the path with mergeinfo.  If that didn't make sense here is
an example of what I mean:

The mergeinfo on trunk is:
  svn:mergeinfo
    /branches/1.4.x:9134
    /branches
/LogCacheEnhancement:9629-9630,9653,9691-9692,9860,9864,9867,9869-9872,9876-9880,10561-10564,10601-10706,10821-10866,10871-10887,11153,11155,11234-11241,11243,11246,11248-11252

The mergeinf on trunk/src/LogCache/Streams/BLOBInStream.h' is:
                                   ^^^^^^^
  svn:mergeinfo
    /branches/1.4.x/src/LogCache/BLOBInStream.h:9134
    /branches/LogCacheEnhancement/src/LogCache/BLOBInStream.h:9629-9630,9653,9691-9692,9860,9864,9867,9869-9872,9876-9880,10561-10564,10601-10706,10821-10866,10871-10887,11153,11155,11234-11241,11243,11246,11248-11252

But for the path difference accounted for by "Streams" the mergeinfo
on BLOBInStream.h would have elided to the root of trunk during any
merge to trunk.  There are scores of other paths with explicit
mergeinfo that are in a similar situation.

>> Anyhow, I'll be looking at the code again to see where improvements can be
>> made.
>
> Thanks!

In r36444 I made a minor tweak to the merge code that potentially
avoids a network round trip for some or all of the subtrees with
explicit mergeinfo in the merge target.  In your original example this
optimization is in full effect and now the merge takes just over two
minutes for me (using serf):

C:\SVN\TSVN.trunk>timethis svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
TimeThis :    Start Time :  Mon Mar 09 13:59:07 2009

--- Reverse-merging r15456 into
'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
--- Reverse-merging r15456 into
'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
TimeThis :    Start Time :  Mon Mar 09 13:59:07 2009
TimeThis :      End Time :  Mon Mar 09 14:01:18 2009
TimeThis :  Elapsed Time :  00:02:11.296

This is still slow, but is big improvement.  I'm looking into further
improvements so hopefully there is more to come.

Paul

> Since larger projects will probably use local
> merges, they could also produce a larger number
> of local svn:mergeinfo.
>
> -- Stefan^2.
>
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1300254


Re: Performance regression with reverse merge

Posted by Stefan Fuhrmann <st...@alice-dsl.de>.
Paul Burba wrote:
> Stefan Fuhrmann wrote:
> >> > Paul Burba wrote:
> >> >> but it does tell
> >> >> us something we already knew: A significant part of merge's slowdown
> >> >> in 1.5.0+ is due to the need to walk the working copy looking for
> >> >> explicit subtree mergeinfo.  This is not something we can skip for
> >> >> mergeinfo aware merges, we need to know about these subtrees.  Though
> >> >> the ongoing WCNG work will probably make it a *lot* faster.
> >> >
> >> > Hm. Looking at the measured data tells a different story:
> >> > the client is responsible for less than 1% of the runtime
> >> > (<3s of 350s total). The very constant flow of data between
> >> > client and server is an indication for a similar situation on
> >> > the server.
>
> Hi Stefan,
>
> When I said "make it a *lot* faster" the "it" I was referring to was
> the time to perform the walk to find all the subtree mergeinfo.  In my
> testing the time spent doing the walk for subtree mergeinfo was
> approximately 3 minutes of the 9 minute merge -- hence "a significant
> part of merge's slowdown" (at least for me! YMMV).

Perhaps we are missing each others point. I don't question
that the WC walk accounts for a major part of the run-time.

However, neither disk I/O nor CPU is used more but marginally
during that time. It is the network I/O that sees a constant trickle
of small packages (4k in, 4k out per second). My conclusion is
that during the WC walk, the client spends most time waiting
for the server.

Unless the number of C/S interaction is reduced by the WCNG
design, I expect no significant performance improvement.

> >> > That means, the most time is spent on the network with
> >> > 1500 .. 2000 roundtrips (given a 187ms ping). So, you are
> >> > right that the whole WC is crawled for mergeinfo. But the
> >> > real problem is that for every 'relevant' node, there is an
> >> > individual communication with the server. A faster WC
> >> > implementation alone will have no effect here.
>
> Agreed, but again, for me the crawl is a significant chunk of time.
>
> > IMHO, there are two approaches to speeding things up:
> >
> > * stream / interleave C/S communication
> >  (would serf be of any help here?)
>
> It seems so yes.  Could you try the merge with serf and see what you
> find?  I saw a pretty dramatic improvement using serf over neon:
>
> 1.6.0.RC3.RA_NEON>C:\SVN\TSVN>timethis svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
>
> TimeThis :  Command Line :  svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
> TimeThis :    Start Time :  Wed Mar 04 10:02:29 2009
>
> --- Reverse-merging r15456 into
> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
> --- Reverse-merging r15456 into
> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h
>
> TimeThis :  Command Line :  svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
> TimeThis :    Start Time :  Wed Mar 04 10:02:29 2009
> TimeThis :      End Time :  Wed Mar 04 10:11:36 2009
> TimeThis :  Elapsed Time :  00:09:07.140
>
> 1.6.0.RC3.RA_SERF>C:\SVN\TSVN>timethis svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
>
> TimeThis :  Command Line :  svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
> TimeThis :    Start Time :  Wed Mar 04 10:12:32 2009
>
> --- Reverse-merging r15456 into
> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
> --- Reverse-merging r15456 into
> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h
>
> TimeThis :  Command Line :  svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
> TimeThis :    Start Time :  Wed Mar 04 10:12:32 2009
> TimeThis :      End Time :  Wed Mar 04 10:16:36 2009
> TimeThis :  Elapsed Time :  00:04:04.421
>
> Still pokey, but it's something.  And as I said, for me almost 3
> minutes of this time is spent walking to target tree looking for
> mergeinfo.  WCNG should drop that to a fraction of the time, so then
> we could be looking at about a minute.

Here we go (SVN 1.6.0-RC3, i686 LINUX):

$time ./svn co http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN -r 
15533 --ignore-externals > /dev/null

	serf     	neon
real	2m41.073s	2m15.268s
user	0m54.107s	0m6.840s
sys	1m25.297s	0m3.672s

$time ./svn merge -r 15456:15455  
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN

	serf     	neon
real	5m29.002s	6m43.831s
user	0m1.992s	0m2.124s
sys	0m0.824s	0m0.664s

Hm. Merge is 20% faster over Serf but c/o is 20% slower.
More importantly, c/o is CPU-bound with Serf!
That is really unexpected.

> Beyond that, improvements are going to be harder to come by in this
> example because http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
> has so much explicit subtree mergeinfo, *226* paths in fact!  I assume
> this is what you are referring to as "every 'relevant' node".  Do you
> know how all of this mergeinfo came about?  Do you do 'subtree
> merges'? (i.e. a merge directly targeting a subtree of a branch rather
> than its root).

TSVN developers use SVN close to HEAD. It seems
that most of this merge info was added during 1.5
development (around Oct 2007), i.e. the result
of alpha-quality code.

Bug in function previous_segment of subversion/libsvn_subr/path.c on trunk 36335

Posted by Marc Haesen <ma...@oneaccess-net.com>.
When running the attached batch file in windows at the root dir of a
drive, I discovered a problem in the previous_segment routine of
subversion/libsvn_subr/path.c.

static apr_size_t
previous_segment(const char *path,
                 apr_size_t len)
{
  if (len == 0)
    return 0;

  while (len > 0 && path[--len] != '/')
    ;

  if (len == 0 && path[0] == '/')
    return 1;
  else
    return len;
}

The case of an absolute path with no previous segments is handled
correctly on unix but not on windows.

For windows it should be changed to:

static apr_size_t
previous_segment(const char *path,
                 apr_size_t len)
{
  if (len == 0)
    return 0;

  while (len > 0 && path[--len] != '/')
    ;

  if (len == 0 && path[0] == '/')
    return 1;
  else
  {
    #ifdef WIN32
    if (len==2 && path[1]==':')
      return 3;
    #endif
    return len;
  }
}

With this fix, the attached batch file is running fine.

Regards,
Marc

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1271821

Re: Performance regression with reverse merge

Posted by Paul Burba <pt...@gmail.com>.
On Thu, Mar 5, 2009 at 4:24 AM, Stefan Fuhrmann
<st...@alice-dsl.de> wrote:
> Mark Phippard wrote:
>> On Wed, Mar 4, 2009 at 5:29 AM, Stefan Fuhrmann
>>
>> <st...@alice-dsl.de> wrote:
>> > I did some more tests and found that the runtime for
>> > 'ordinary' merges between branches is roughly the same
>> > (4+ minutes instead of 6+ but the sub-tree in question was
>> > significantly smaller on that branch).
>> >
>> >> but it does tell
>> >> us something we already knew: A significant part of merge's slowdown
>> >> in 1.5.0+ is due to the need to walk the working copy looking for
>> >> explicit subtree mergeinfo.  This is not something we can skip for
>> >> mergeinfo aware merges, we need to know about these subtrees.  Though
>> >> the ongoing WCNG work will probably make it a *lot* faster.
>> >
>> > Hm. Looking at the measured data tells a different story:
>> > the client is responsible for less than 1% of the runtime
>> > (<3s of 350s total). The very constant flow of data between
>> > client and server is an indication for a similar situation on
>> > the server.

Hi Stefan,

When I said "make it a *lot* faster" the "it" I was referring to was
the time to perform the walk to find all the subtree mergeinfo.  In my
testing the time spent doing the walk for subtree mergeinfo was
approximately 3 minutes of the 9 minute merge -- hence "a significant
part of merge's slowdown" (at least for me! YMMV).

>> > That means, the most time is spent on the network with
>> > 1500 .. 2000 roundtrips (given a 187ms ping). So, you are
>> > right that the whole WC is crawled for mergeinfo. But the
>> > real problem is that for every 'relevant' node, there is an
>> > individual communication with the server. A faster WC
>> > implementation alone will have no effect here.

Agreed, but again, for me the crawl is a significant chunk of time.

>> I wonder if this is now where you are running into the optimization
>> that went into 1.5.  Before you did the merge, did you run update so
>> that your WC was at a single revision for the entire WC?  This has an
>> enormous impact on performance and I think this is what you were
>> running into.  Paul can describe it better, but if the WC is not at a
>> single revision then the code has to do more roundtrips to discover
>> mergeinfo that might exist in the repository.
>
> Those WCs were fresh check-outs. Paul, I guess, also just
> made a check out and started his timings.

That is correct.

> The svn:externals used by TSVN don't seem to be the culprit
> either, because the timing was only proportionally better
> when I used a smaller sub-tree with no externals in it.
>
> Back to your question whether this is a release blocker: No.
> Performance got much worse in 1.5 but remained stable in 1.6.
> So 1.6 performance is just as acceptable as the previous version.
>
> I provided the reproduction recipe with some public, real-world
> repo so that Paul and others could analyze it thoroughly and
> make it faster.

That is great, having an real-world example to work with is extremely helpful.

> IMHO, there are two approaches to speeding things up:
>
> * stream / interleave C/S communication
>  (would serf be of any help here?)

It seems so yes.  Could you try the merge with serf and see what you
find?  I saw a pretty dramatic improvement using serf over neon:

1.6.0.RC3.RA_NEON>C:\SVN\TSVN>timethis svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
TimeThis :    Start Time :  Wed Mar 04 10:02:29 2009

--- Reverse-merging r15456 into
'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
--- Reverse-merging r15456 into
'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
TimeThis :    Start Time :  Wed Mar 04 10:02:29 2009
TimeThis :      End Time :  Wed Mar 04 10:11:36 2009
TimeThis :  Elapsed Time :  00:09:07.140

1.6.0.RC3.RA_SERF>C:\SVN\TSVN>timethis svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
TimeThis :    Start Time :  Wed Mar 04 10:12:32 2009

--- Reverse-merging r15456 into
'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
--- Reverse-merging r15456 into
'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
TimeThis :    Start Time :  Wed Mar 04 10:12:32 2009
TimeThis :      End Time :  Wed Mar 04 10:16:36 2009
TimeThis :  Elapsed Time :  00:04:04.421

Still pokey, but it's something.  And as I said, for me almost 3
minutes of this time is spent walking to target tree looking for
mergeinfo.  WCNG should drop that to a fraction of the time, so then
we could be looking at about a minute.

Beyond that, improvements are going to be harder to come by in this
example because http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
has so much explicit subtree mergeinfo, *226* paths in fact!  I assume
this is what you are referring to as "every 'relevant' node".  Do you
know how all of this mergeinfo came about?  Do you do 'subtree
merges'? (i.e. a merge directly targeting a subtree of a branch rather
than its root).

Anyhow, I'll be looking at the code again to see where improvements can be made.

Paul

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1272752


Re: Performance regression with reverse merge

Posted by Stefan Fuhrmann <st...@alice-dsl.de>.
Mark Phippard wrote:
> On Wed, Mar 4, 2009 at 5:29 AM, Stefan Fuhrmann
>
> <st...@alice-dsl.de> wrote:
> > I did some more tests and found that the runtime for
> > 'ordinary' merges between branches is roughly the same
> > (4+ minutes instead of 6+ but the sub-tree in question was
> > significantly smaller on that branch).
> >
> >> but it does tell
> >> us something we already knew: A significant part of merge's slowdown
> >> in 1.5.0+ is due to the need to walk the working copy looking for
> >> explicit subtree mergeinfo.  This is not something we can skip for
> >> mergeinfo aware merges, we need to know about these subtrees.  Though
> >> the ongoing WCNG work will probably make it a *lot* faster.
> >
> > Hm. Looking at the measured data tells a different story:
> > the client is responsible for less than 1% of the runtime
> > (<3s of 350s total). The very constant flow of data between
> > client and server is an indication for a similar situation on
> > the server.
> >
> > That means, the most time is spent on the network with
> > 1500 .. 2000 roundtrips (given a 187ms ping). So, you are
> > right that the whole WC is crawled for mergeinfo. But the
> > real problem is that for every 'relevant' node, there is an
> > individual communication with the server. A faster WC
> > implementation alone will have no effect here.
>
> I wonder if this is now where you are running into the optimization
> that went into 1.5.  Before you did the merge, did you run update so
> that your WC was at a single revision for the entire WC?  This has an
> enormous impact on performance and I think this is what you were
> running into.  Paul can describe it better, but if the WC is not at a
> single revision then the code has to do more roundtrips to discover
> mergeinfo that might exist in the repository.

Those WCs were fresh check-outs. Paul, I guess, also just
made a check out and started his timings.

The svn:externals used by TSVN don't seem to be the culprit
either, because the timing was only proportionally better 
when I used a smaller sub-tree with no externals in it.

Back to your question whether this is a release blocker: No.
Performance got much worse in 1.5 but remained stable in 1.6.
So 1.6 performance is just as acceptable as the previous version.

I provided the reproduction recipe with some public, real-world 
repo so that Paul and others could analyze it thoroughly and 
make it faster.

-- Stefan^2.



Re: Performance regression with reverse merge

Posted by Mark Phippard <ma...@gmail.com>.
On Wed, Mar 4, 2009 at 5:29 AM, Stefan Fuhrmann
<st...@alice-dsl.de> wrote:

> I did some more tests and found that the runtime for
> 'ordinary' merges between branches is roughly the same
> (4+ minutes instead of 6+ but the sub-tree in question was
> significantly smaller on that branch).
>
>> but it does tell
>> us something we already knew: A significant part of merge's slowdown
>> in 1.5.0+ is due to the need to walk the working copy looking for
>> explicit subtree mergeinfo.  This is not something we can skip for
>> mergeinfo aware merges, we need to know about these subtrees.  Though
>> the ongoing WCNG work will probably make it a *lot* faster.
>
> Hm. Looking at the measured data tells a different story:
> the client is responsible for less than 1% of the runtime
> (<3s of 350s total). The very constant flow of data between
> client and server is an indication for a similar situation on
> the server.
>
> That means, the most time is spent on the network with
> 1500 .. 2000 roundtrips (given a 187ms ping). So, you are
> right that the whole WC is crawled for mergeinfo. But the
> real problem is that for every 'relevant' node, there is an
> individual communication with the server. A faster WC
> implementation alone will have no effect here.

I wonder if this is now where you are running into the optimization
that went into 1.5.  Before you did the merge, did you run update so
that your WC was at a single revision for the entire WC?  This has an
enormous impact on performance and I think this is what you were
running into.  Paul can describe it better, but if the WC is not at a
single revision then the code has to do more roundtrips to discover
mergeinfo that might exist in the repository.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1266589


Re: Performance regression with reverse merge

Posted by Stefan Fuhrmann <st...@alice-dsl.de>.
Paul Burba <pt...@gmail.com> wrote:

> This delay was due to a needless walk of the merge target looking for
> subtrees with mergeinfo.  If we stop this walk then the
> --ignore-ancestry merge with 1.6.0.RC3 is more on par with 1.4.6:
>
> 1.6.0.RC3.PATCHED>C:\SVN\TSVN>timethis svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry
>
> TimeThis :  Command Line :  svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry
> TimeThis :    Start Time :  Mon Mar 02 14:16:54 2009
>
> --- Reverse-merging r15456 into '.':
> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h
>
> TimeThis :  Command Line :  svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry
> TimeThis :    Start Time :  Mon Mar 02 14:16:54 2009
> TimeThis :      End Time :  Mon Mar 02 14:17:10 2009
> TimeThis :  Elapsed Time :  00:00:16.093
>
> I'll commit this improvement to trunk and nominate it for backport to
> 1.5.x and 1.6.x.  Obviously this does not address the merge aware
> performance that caused Stefan to start this thread,

Very good! At least there is a workaround for the issue
initially reported. 

I did some more tests and found that the runtime for 
'ordinary' merges between branches is roughly the same 
(4+ minutes instead of 6+ but the sub-tree in question was 
significantly smaller on that branch).

> but it does tell
> us something we already knew: A significant part of merge's slowdown
> in 1.5.0+ is due to the need to walk the working copy looking for
> explicit subtree mergeinfo.  This is not something we can skip for
> mergeinfo aware merges, we need to know about these subtrees.  Though
> the ongoing WCNG work will probably make it a *lot* faster.  

Hm. Looking at the measured data tells a different story:
the client is responsible for less than 1% of the runtime
(<3s of 350s total). The very constant flow of data between
client and server is an indication for a similar situation on
the server.

That means, the most time is spent on the network with
1500 .. 2000 roundtrips (given a 187ms ping). So, you are
right that the whole WC is crawled for mergeinfo. But the
real problem is that for every 'relevant' node, there is an
individual communication with the server. A faster WC
implementation alone will have no effect here.

IMHO, there are two approaches to speeding things up:

* stream / interleave C/S communication
  (would serf be of any help here?)
* aggregate communication into larger digests
  (e.g. one per folder)

Given the assumed high number of roundtrips, you may
spend a lot more CPU cycles on the client if that helps
to reduce network time.

> There
> might also be some special casing we can do for reverse merges from a
> path's own natural history, I'll look into that.

That would certainly help because TSVN users may not
realize that 'revert changes from this revision' is actually
a merge. 

-- Stefan^2.

Re: Performance regression with reverse merge

Posted by Paul Burba <pt...@gmail.com>.
On Mon, Mar 2, 2009 at 11:16 AM, Paul Burba <pt...@gmail.com> wrote:

> FWIW here is my timing:
>
> =========
> 1.6.0.RC3
> =========
>
> 1.6.0.RC3>timethis svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
>
> TimeThis :  Command Line :  svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
> TimeThis :    Start Time :  Mon Mar 02 09:47:28 2009
>
> --- Reverse-merging r15456 into
> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
> --- Reverse-merging r15456 into
> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h
>
> TimeThis :  Command Line :  svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
> TimeThis :    Start Time :  Mon Mar 02 09:47:28 2009
> TimeThis :      End Time :  Mon Mar 02 09:56:25 2009
> TimeThis :  Elapsed Time :  00:08:57.296
>
>
> What is interesting, if we do this merge with --ignore-ancestry, which
> effectively disables all merge tracking, the merge is much quicker
> (appx 3 minutes vs 9 minutes) but is still much slower in 1.6.0/1.5.6
> when compared to 1.4.6 (i.e. appx 3 minutes vs 8 seconds).  So there
> is something else slowing us down too:
>
>
> ===========================
> 1.6.0.RC3 --ignore-ancestry
> ===========================
>
> 1.6.0.RC3>C:\SVN\TSVN>timethis svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry
>
> TimeThis :  Command Line :  svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry
> TimeThis :    Start Time :  Mon Mar 02 10:04:29 2009
>
> --- Reverse-merging r15456 into
> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
> --- Reverse-merging r15456 into
> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h
>
> TimeThis :  Command Line :  svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry
> TimeThis :    Start Time :  Mon Mar 02 10:04:29 2009
> TimeThis :      End Time :  Mon Mar 02 10:07:27 2009
> TimeThis :  Elapsed Time :  00:02:58.562

This delay was due to a needless walk of the merge target looking for
subtrees with mergeinfo.  If we stop this walk then the
--ignore-ancestry merge with 1.6.0.RC3 is more on par with 1.4.6:

1.6.0.RC3.PATCHED>C:\SVN\TSVN>timethis svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry
TimeThis :    Start Time :  Mon Mar 02 14:16:54 2009

--- Reverse-merging r15456 into '.':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry
TimeThis :    Start Time :  Mon Mar 02 14:16:54 2009
TimeThis :      End Time :  Mon Mar 02 14:17:10 2009
TimeThis :  Elapsed Time :  00:00:16.093

I'll commit this improvement to trunk and nominate it for backport to
1.5.x and 1.6.x.  Obviously this does not address the merge aware
performance that caused Stefan to start this thread, but it does tell
us something we already knew: A significant part of merge's slowdown
in 1.5.0+ is due to the need to walk the working copy looking for
explicit subtree mergeinfo.  This is not something we can skip for
mergeinfo aware merges, we need to know about these subtrees.  Though
the ongoing WCNG work will probably make it a *lot* faster.  There
might also be some special casing we can do for reverse merges from a
path's own natural history, I'll look into that.

Paul

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1257793


Re: Performance regression with reverse merge

Posted by Paul Burba <pt...@gmail.com>.
On Sun, Mar 1, 2009 at 3:34 PM, Mark Phippard <ma...@gmail.com> wrote:
> On Sun, Mar 1, 2009 at 2:52 PM, Stefan Fuhrmann
> <st...@alice-dsl.de> wrote:
>> On Sunday 01 March 2009 18:33:48 Mark Phippard wrote:
>>
>>> > $ uname -a
>>> > Linux opti 2.6.24-23-generic #1 SMP Mon Jan 26 00:13:11 UTC 2009 i686
>>> > GNU/Linux $ svn --version
>>> > svn, version 1.4.6 (r28521)
>>>
>>> Since you are calling this a 1.6 regression, why are you not comparing
>>> against 1.5.6?
>>
>> Sorry! My bad; I wanted the post out quickly and had no
>> 1.5 on my machine.
>>
>> 1.5.6 numbers:
>>
>> $ time ./svn merge -r 15456:15455
>> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN3
>> --- Reverse-merging r15456 into
>> '/home/stefan/TSVN3/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp':
>> U    /home/stefan/TSVN3/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp
>> --- Reverse-merging r15456 into
>> '/home/stefan/TSVN3/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h':
>> U    /home/stefan/TSVN3/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h
>>
>> real    6m52.263s
>> user    0m2.220s
>> sys     0m0.564s
>>
>> So, this is basically the same as for 1.6.
>> Obviously, I never needed to undo revisions
>> for quite a long time.
>
> So then there is no release blocking 1.6 regression here.  Agree?
> Mainly we need to look into why this is slow and see if it can be
> improved.
>
> pburba made an optimization so that if your WC is at a single uniform
> revision that it does some performance stuff that made a big
> difference.  I wonder if it is not implemented for reverse merge?

Mark,

You are referring to r33112 yes?  That change improved the performance
of libsvn_client/merge.c:filter_self_referential_mergeinfo(), but that
function isn't even called during reverse merges since r33026, so that
is not the cause of the poor performance in this case.

> Can
> you try merging a single revision from a branch to see if the
> performance is similar or better?
>
>>> > $ svn co http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk -r15533
>>> > ~/TSVN > /dev/null
>>>
>>> You might have mentioned how long it takes this checkout to run?  I am
>>> running checkout from a box in the CollabNet network and it is still
>>> taking forever.
>>
>> Hm. Around 4 minutes here, including externals.
>> I didn't want to clutter my post with numbers
>> that I didn't consider relevant for merge performance.
>
> That is strange.  I was basically LAN-connected to tigris and I think
> checkout took between 15 and 20 minutes.  It was long enough that I
> decided it was taking a long time and that I'd also run the tests on a
> different system (Windows).  Managed to connect to that box, run the
> diff tests, find and install the timethis.exe software and get most of
> the "src" checkout done.

FWIW here is my timing:

=========
1.6.0.RC3
=========

1.6.0.RC3>timethis svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
TimeThis :    Start Time :  Mon Mar 02 09:47:28 2009

--- Reverse-merging r15456 into
'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
--- Reverse-merging r15456 into
'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
TimeThis :    Start Time :  Mon Mar 02 09:47:28 2009
TimeThis :      End Time :  Mon Mar 02 09:56:25 2009
TimeThis :  Elapsed Time :  00:08:57.296


What is interesting, if we do this merge with --ignore-ancestry, which
effectively disables all merge tracking, the merge is much quicker
(appx 3 minutes vs 9 minutes) but is still much slower in 1.6.0/1.5.6
when compared to 1.4.6 (i.e. appx 3 minutes vs 8 seconds).  So there
is something else slowing us down too:


===========================
1.6.0.RC3 --ignore-ancestry
===========================

1.6.0.RC3>C:\SVN\TSVN>timethis svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry
TimeThis :    Start Time :  Mon Mar 02 10:04:29 2009

--- Reverse-merging r15456 into
'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
--- Reverse-merging r15456 into
'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry
TimeThis :    Start Time :  Mon Mar 02 10:04:29 2009
TimeThis :      End Time :  Mon Mar 02 10:07:27 2009
TimeThis :  Elapsed Time :  00:02:58.562


=======================
1.5.6 --ignore-ancestry
=======================

1.5.6>C:\SVN\TSVN.1.5.6>timethis svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry
TimeThis :    Start Time :  Mon Mar 02 10:23:01 2009

--- Reverse-merging r15456 into
'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
--- Reverse-merging r15456 into
'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk --ignore-ancestry
TimeThis :    Start Time :  Mon Mar 02 10:23:01 2009
TimeThis :      End Time :  Mon Mar 02 10:26:02 2009
TimeThis :  Elapsed Time :  00:03:00.937


=====
1.4.6
=====

1.4.6>C:\SVN\TSVN.1.4.6>timethis svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
TimeThis :    Start Time :  Mon Mar 02 10:34:32 2009

U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h

TimeThis :  Command Line :  svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
TimeThis :    Start Time :  Mon Mar 02 10:34:32 2009
TimeThis :      End Time :  Mon Mar 02 10:34:41 2009
TimeThis :  Elapsed Time :  00:00:08.171

Paul

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1256875


Re: Performance regression with reverse merge

Posted by Talden <ta...@gmail.com>.
On Mon, Mar 2, 2009 at 9:34 AM, Mark Phippard <ma...@gmail.com> wrote:
> So then there is no release blocking 1.6 regression here.  Agree?
> Mainly we need to look into why this is slow and see if it can be
> improved.

I'd define it as a regression that was missed in an earlier release.
If it would have been considered a blocker then it should be
considered a blocker now - since users are surely supported in
upgrading from 1.5.0 --> 1.6.0 skipping 1.5.6.

--
Talden

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1252648


Re: Performance regression with reverse merge

Posted by Mark Phippard <ma...@gmail.com>.
On Sun, Mar 1, 2009 at 2:52 PM, Stefan Fuhrmann
<st...@alice-dsl.de> wrote:
> On Sunday 01 March 2009 18:33:48 Mark Phippard wrote:
>
>> > $ uname -a
>> > Linux opti 2.6.24-23-generic #1 SMP Mon Jan 26 00:13:11 UTC 2009 i686
>> > GNU/Linux $ svn --version
>> > svn, version 1.4.6 (r28521)
>>
>> Since you are calling this a 1.6 regression, why are you not comparing
>> against 1.5.6?
>
> Sorry! My bad; I wanted the post out quickly and had no
> 1.5 on my machine.
>
> 1.5.6 numbers:
>
> $ time ./svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN3
> --- Reverse-merging r15456 into
> '/home/stefan/TSVN3/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp':
> U    /home/stefan/TSVN3/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp
> --- Reverse-merging r15456 into
> '/home/stefan/TSVN3/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h':
> U    /home/stefan/TSVN3/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h
>
> real    6m52.263s
> user    0m2.220s
> sys     0m0.564s
>
> So, this is basically the same as for 1.6.
> Obviously, I never needed to undo revisions
> for quite a long time.

So then there is no release blocking 1.6 regression here.  Agree?
Mainly we need to look into why this is slow and see if it can be
improved.

pburba made an optimization so that if your WC is at a single uniform
revision that it does some performance stuff that made a big
difference.  I wonder if it is not implemented for reverse merge?  Can
you try merging a single revision from a branch to see if the
performance is similar or better?

>> > $ svn co http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk -r15533
>> > ~/TSVN > /dev/null
>>
>> You might have mentioned how long it takes this checkout to run?  I am
>> running checkout from a box in the CollabNet network and it is still
>> taking forever.
>
> Hm. Around 4 minutes here, including externals.
> I didn't want to clutter my post with numbers
> that I didn't consider relevant for merge performance.

That is strange.  I was basically LAN-connected to tigris and I think
checkout took between 15 and 20 minutes.  It was long enough that I
decided it was taking a long time and that I'd also run the tests on a
different system (Windows).  Managed to connect to that box, run the
diff tests, find and install the timethis.exe software and get most of
the "src" checkout done.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1252275


Re: Performance regression with reverse merge

Posted by Stefan Fuhrmann <st...@alice-dsl.de>.
On Sunday 01 March 2009 18:33:48 Mark Phippard wrote:

> > $ uname -a
> > Linux opti 2.6.24-23-generic #1 SMP Mon Jan 26 00:13:11 UTC 2009 i686
> > GNU/Linux $ svn --version
> > svn, version 1.4.6 (r28521)
>
> Since you are calling this a 1.6 regression, why are you not comparing
> against 1.5.6?

Sorry! My bad; I wanted the post out quickly and had no
1.5 on my machine. 

1.5.6 numbers:

$ time ./svn merge -r 15456:15455 
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN3
--- Reverse-merging r15456 into 
'/home/stefan/TSVN3/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp':
U    /home/stefan/TSVN3/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp
--- Reverse-merging r15456 into 
'/home/stefan/TSVN3/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h':
U    /home/stefan/TSVN3/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h

real	6m52.263s
user	0m2.220s
sys	0m0.564s

So, this is basically the same as for 1.6.
Obviously, I never needed to undo revisions
for quite a long time.

> > <snip>
> > $ svn co http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk -r15533
> > ~/TSVN > /dev/null
>
> You might have mentioned how long it takes this checkout to run?  I am
> running checkout from a box in the CollabNet network and it is still
> taking forever.

Hm. Around 4 minutes here, including externals.
I didn't want to clutter my post with numbers
that I didn't consider relevant for merge performance.

-- Stefan^2.


Re: Performance regression with reverse merge

Posted by Stefan Fuhrmann <st...@alice-dsl.de>.
Paul Burba wrote:
> Stefan Fuhrmann wrote:
> > Paul Burba wrote:
> >> Stefan Fuhrmann wrote:

> > Here we go (SVN 1.6.0-RC3, i686 LINUX):
> >
> > $time ./svn co http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN
> > -r 15533 --ignore-externals > /dev/null
> >
> >        serf            neon
> > real    2m41.073s       2m15.268s
> > user    0m54.107s       0m6.840s
> > sys     1m25.297s       0m3.672s
> >
> > $time ./svn merge -r 15456:15455
> > http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN
> >
> >        serf            neon
> > real    5m29.002s       6m43.831s
> > user    0m1.992s        0m2.124s
> > sys     0m0.824s        0m0.664s
> >
> > Hm. Merge is 20% faster over Serf but c/o is 20% slower.
> > More importantly, c/o is CPU-bound with Serf!
> > That is really unexpected.
>
> Hmmmm, that is unexpected.

Perhaps I can come up with some profiling data over the weekend.

> >> Beyond that, improvements are going to be harder to come by in this
> >> example because http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
> >> has so much explicit subtree mergeinfo, *226* paths in fact!  I assume
> >> this is what you are referring to as "every 'relevant' node".  Do you
> >> know how all of this mergeinfo came about?  Do you do 'subtree
> >> merges'? (i.e. a merge directly targeting a subtree of a branch rather
> >> than its root).
> >
> > [snip: caused by 1.5-alpha against 1.3 server]
> >
> > From what I can tell, most of that merge info can
> > be deleted because they refer to revision that did
> > not change the source node. Is it safe to do that or
> > will I screw up the current merge tracking logic?
>
> It really depends on what the subtree mergeinfo is overriding (i.e.
> what would the path inherit for mergeinfo if it had no mergeinfo of
> its own).  Most of subtree mergeinfo on
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk is coming from the
> '/branches/1.4.x/' and '/branches/LogCacheEnhancement' branches.
> Assuming you won't be merging from those branches to trunk (directly
> or from copies of those branches) then I am quite confident you can
> safely delete the mergeinfo from those subtrees.  

Those branches were closed long time ago.
It seems that also simple renames / moves
created mergeinfo as well back then.

I removed the obsolete mergeinfo and performance
is as good as one can expect (reverse-merge r15570):

1.6.0RC3-serf: real ~11sec, CPU ~1.1sec
1.6.0RC3-neon: real ~15sec, CPU ~1.1sec
(same timings for --ignore-ancestry)

trunk@36489-serf: real ~11sec, CPU ~1.1sec
trunk@36489-neon: real ~10sec, CPU ~1.1sec

with --ignore-ancestry
trunk@36489-serf: real ~8sec, CPU ~0.1sec
trunk@36489-neon: real ~9sec, CPU ~0.1sec

You did a very good job with the latest trunk patches!
Neon and serf seem now to be on par performance-wise.

The remaining run-time can be attributed to svn diff.
Perhaps we can shave off some of that, too?

> >> Anyhow, I'll be looking at the code again to see where improvements can
> >> be made.
> >
> > Thanks!
>
> In r36444 I made a minor tweak to the merge code that potentially
> avoids a network round trip for some or all of the subtrees with
> explicit mergeinfo in the merge target.  In your original example this
> optimization is in full effect and now the merge takes just over two
> minutes for me (using serf):
>
> C:\SVN\TSVN.trunk>timethis svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
>
> TimeThis :  Command Line :  svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
> TimeThis :    Start Time :  Mon Mar 09 13:59:07 2009
>
> --- Reverse-merging r15456 into
> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp':
> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
> --- Reverse-merging r15456 into
> 'src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h':
> U    src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h
>
> TimeThis :  Command Line :  svn merge -r 15456:15455
> http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
> TimeThis :    Start Time :  Mon Mar 09 13:59:07 2009
> TimeThis :      End Time :  Mon Mar 09 14:01:18 2009
> TimeThis :  Elapsed Time :  00:02:11.296
>
> This is still slow, but is big improvement.  I'm looking into further
> improvements so hopefully there is more to come.

Numbers over my DSL line:

trunk@36489-serf: real ~193sec, CPU ~2.6sec
trunk@36489-neon: real ~193sec, CPU ~2.6sec

with --ignore-ancestry
trunk@36489-serf: real ~11sec, CPU ~0.1sec
trunk@36489-neon: real ~9sec, CPU ~0.1sec

So, neon and serf on par again, --ignore-ancestry about
as fast as with no mergeinfo properties. Last but not least
a very impressive 100% performance boost.

Maybe, there should be a FAQ entry about avoiding merges
in sub-trees.

-- Stefan^2.





Re: Performance regression with reverse merge

Posted by Mark Phippard <ma...@gmail.com>.
Here is the 1.5.6 merge timing:

$ time svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN
--- Reverse-merging r15456 into
'/home/mphippard/TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp':
U    /home/mphippard/TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp
--- Reverse-merging r15456 into
'/home/mphippard/TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h':
U    /home/mphippard/TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h

real	0m40.362s
user	0m1.289s
sys	0m0.946s

As a reminder, this is what it was for 1.6 RC2:

 real    1m13.431s
 user    0m1.899s
 sys     0m1.507s

So it is slower for sure.  I'd guess the difference is even worse when
the network is slower.

Does the tree conflicts work possibly introduce some new checking and
network turnarounds?

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1251622

Re: Performance regression with reverse merge

Posted by Mark Phippard <ma...@gmail.com>.
So here are my timings from Linux using 1.6.0 RC2.  I'll try again
with 1.5.6 in a bit.  My home folder is on a NetApp, so the svn up
command is just to get a timing on walking and locking the WC.

$ time svn up -r15533 --ignore-externals TSVN
At revision 15533.

real	0m2.575s
user	0m0.052s
sys	0m0.064s
$ time svn diff -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk > /dev/null

real	0m0.494s
user	0m0.019s
sys	0m0.011s
$ time svn merge -r 15456:15455
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk ~/TSVN
--- Reverse-merging r15456 into
'/home/mphippard/TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp':
U    /home/mphippard/TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.cpp
--- Reverse-merging r15456 into
'/home/mphippard/TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h':
U    /home/mphippard/TSVN/src/TortoiseProc/RevisionGraph/RevisionGraphDlg.h

real	1m13.431s
user	0m1.899s
sys	0m1.507s

I also tested from a Windows system running RC2.  For this test, I
only checked out the "src" folder and did the merge relative to it.
Here are those timings.  The Windows tests got to the merge
notifications in a similar timeframe to Linux but then had a really
long delay before finishing.

I agree this seems slower than it ought to be.

H:\>timethis "svn up --ignore-externals -r15533 TSVN_src"

TimeThis :  Command Line :  svn up --ignore-externals -r15533 TSVN_src
TimeThis :    Start Time :  Sun Mar 01 09:48:47 2009

At revision 15533.

TimeThis :  Command Line :  svn up --ignore-externals -r15533 TSVN_src
TimeThis :    Start Time :  Sun Mar 01 09:48:47 2009
TimeThis :      End Time :  Sun Mar 01 09:48:50 2009
TimeThis :  Elapsed Time :  00:00:02.322

H:\>timethis "svn merge -r 15456:15455 http://tortoisesvn.tigris.org/svn/tortois
esvn/trunk/src TSVN_src"

TimeThis :  Command Line :  svn merge -r 15456:15455 http://tortoisesvn.tigris.o
rg/svn/tortoisesvn/trunk/src TSVN_src
TimeThis :    Start Time :  Sun Mar 01 09:49:38 2009

--- Reverse-merging r15456 into 'TSVN_src\TortoiseProc\RevisionGraph\RevisionGra
phDlg.cpp':
U    TSVN_src\TortoiseProc\RevisionGraph\RevisionGraphDlg.cpp
--- Reverse-merging r15456 into 'TSVN_src\TortoiseProc\RevisionGraph\RevisionGra
phDlg.h':
U    TSVN_src\TortoiseProc\RevisionGraph\RevisionGraphDlg.h

TimeThis :  Command Line :  svn merge -r 15456:15455 http://tortoisesvn.tigris.o
rg/svn/tortoisesvn/trunk/src TSVN_src
TimeThis :    Start Time :  Sun Mar 01 09:49:38 2009
TimeThis :      End Time :  Sun Mar 01 09:51:45 2009
TimeThis :  Elapsed Time :  00:02:07.322

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1251558