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

Re: svn list -R of medium-size repository takes 10 hours.

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2005-08-22 19:42:37 CEST

As an experiment, I tweaked the ra_dav code to request only the 5
properties it needs to fill an svn_dirent_t, rather than requesting
*all* properties.

The time it took to do an 'svn ls -R' against subversion own trunk
URL went from about 30 seconds to 15 seconds.

We're still not out of the woods entirely, though. svn_dirent_t has
an annoying "has_props" boolean field that needs to be filled in.
The current code loops through all the returned properties, and looks
to see if any user-defined properties exist in the list. In order to
complete the patch, we'll have to invent some new server-generated
prop that indicates "this resource contains user-defined properties",
and add it to our list of requested props. It also means that this
speedup will only work against 1.3 mod_dav_svn servers; when talking
to older servers, we'll have to still fetch *all* properties just to
find out if user-defined props exist. :-(

I guess another option is to play with deprecating the 'has_props'
field. Maybe create an svn_ra_get_dir2() which doesn't fill in the
has_props field by default, unless you explicitly ask it to. (Does
any client actually use the 'has_props' field?)

Here's the patch I was playing with. (You can play with it, but not
that it's not complete or totally correct! svn_dirent_t->has_props
is always 0.)

Index: subversion/libsvn_ra_dav/fetch.c
--- subversion/libsvn_ra_dav/fetch.c (revision 15883)
+++ subversion/libsvn_ra_dav/fetch.c (working copy)
@@ -915,6 +915,20 @@
+/* the properties we need to fill in an svn_dirent_t, used by
+ svn_ra_get_dir(). */
+static const ne_propname dirent_props[] =
+ { "DAV:", "resourcetype" }, /* kind */
+ { "DAV:", "getcontentlength" }, /* size */
+ { "DAV:", "version-name" }, /* created_rev */
+ { "DAV:", "creationdate" }, /* time */
+ { "DAV:", "creator-displayname" }, /* last_author */
+ { NULL }
svn_error_t *svn_ra_dav__get_dir(svn_ra_session_t *session,
                                   const char *path,
                                   svn_revnum_t revision,
@@ -961,7 +975,7 @@
           PROPFIND on the directory of depth 1. */
        SVN_ERR( svn_ra_dav__get_props(&resources, ras->sess,
                                       final_url, NE_DEPTH_ONE,
- NULL, NULL /* all props */,
pool) );
+ NULL, dirent_props, pool) );

        /* Count the number of path components in final_url. */
        final_url_n_components = svn_path_component_count(final_url);

www.collab.net  <>  CollabNet  |  Distributed Development On Demand
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 22 19:46:31 2005

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.