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

Re: New svn_path_is_root "X:" stuff makes Subversion sslllooowww

From: Lieven Govaerts <svnlgo_at_mobsol.be>
Date: 2006-10-21 20:11:07 CEST

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[0] == '/') 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: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 20:11:38 2006

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

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