Philip Martin wrote:
> The new support for "X:" Windows paths has a substantial performance
> penalty, on Unix at least. When running "svn st" on a pristine
> working copy of the Subversion source code the new code needs about
> four times the CPU and runtime of the old code. r21277 seems to be
> the main culprit:
> I suppose we could make the expensive svn_path_is_root stuff Windows
> specific, but really I don't think the current stuff is suitable
> anywhere. When I added the is_canonical stuff it was intended to be
> fast, I even commented out some of the calls I used during development
> in order to avoid extra strlen calls. Now is_canonical is creating
> pools and doing utf8 conversions, it's simply much too slow.
There was a lot of discussion on IRC some weeks ago concerning the
performance impact of the svn_path_is_root function. A number of
possible ways to improve it have come up:
The apr function apr_filepath_root is clearly not ideal for our use
case. Not only does it require a string in cstring format, it also
calculates both the root and relative part of the path, we need neither
of them. Suggestions on improvement:
1. Do not convert the path to cstring before calling apr_filepath_root,
as it's not really needed for just finding out if a path is root or not.
2. Only use apr_filepath_root on Windows / Cygwin, add the (len == 1 &&
path == '/') test for all other platforms.
3. Copy the code from apr_filepath_root in a new function in
libsvn_subr/path.c and remove all code unneeded for our use case.
Optimize path functions to use svn_path_is_root as little as possible
4. Remove calls to is_canonical().
5. Evaluate the other algorithms in path.c and remove calls to
svn_path_is_root where possible
The new code for Windows path handling also broke our UNC support. Since
there were no unit tests for UNC support, I wasn't even aware that we
supported that on Windows, but apparently svn 1.4.0 does. I've added new
unit tests for UNC support in r22067, currently they're XFailing.
I propose to fix the UNC path support first while at the same time
working on suggestion 5. To really solve the performance penalty of
Windows path support we need to implement all of the above suggestions.
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Sat Oct 21 20:11:38 2006