[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[TSVN] More on Commit dialog performance

From: Will Dean <svn_at_indcomp.co.uk>
Date: 2004-12-15 18:09:19 CET

I'm having a general look at performance populating the commit dialog,
which is currently very poor on large WCs (even/particularly where there
are lots of unversioned files).

I think a major perf hotspot for large directory trees is the code in
CSVNStatusListCtrl::Stat which checks if there are 'unversioned' files
which differ only in case in from ones which are already in the repository.

As implemented, this checks every unversioned filename against every other
filename in the whole tree to see if it (case-insensitive) matches.

There is a mechanism in the code to prevent this test being run for the
contents of 'unversioned' folders, but I suspect that this mechanism is
currently broken.

Another problem is the way in which the string compare is being done. This
uses the CString 'CompareNoCase' function to compare two CStrings. Because
the CompareNoCase function actually takes a TCHAR*, the actual compare ends
up being done by a 'c' style stricmp function, which does a char-by-char

There are two issues here - one is that before we started the compare, we
knew the lengths of both the string objects (because CString has an
embedded length) - as we're only interested in whether the items match, and
not their lexical order, we should compare the lengths before going to the
string comparison. The other issue is that the type of data we're
comparing is *appallingly slow* to compare with a stricmp-style function
which starts at the left and works across - if we must do lots of
stricmp-type operations, we should probably write a compare which works
from the right. (Which you can do efficiently with two CStrings, because
you already know the length before you start.)

My profiler thought that there were 36000 stricmp's needed to put 6 items
into the commit dialog on a working copy with about 2000 files in the tree,
so this isn't an issue we should ignore.

If Stefan's happy, I might submit a patch on some of this later this evening.



To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Wed Dec 15 18:11:56 2004

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.