Author: julianfoad
Date: Tue Feb  6 13:44:17 2018
New Revision: 1823327

URL: http://svn.apache.org/viewvc?rev=1823327&view=rev
Log:
Performance: Make the 'info' command fast on old repository revisions.

The svn_client_info4() API reports the lock status of the given URL (at
head, implicitly) if that is the same resource as the given URL and
revision. The 'same resource' check was inefficient, searching history
forwards from the given revision up to head.

The problem was present even when a peg revision is specified and even when
the 'svn info --show-item=x' option is used. (The 'show-item' filtering is
not performed in the library.)

Example: 'svn info https://svn.apache.org/repos/asf/subversion@850000'
took 13s before and 2s after this change.

See http://colabti.org/irclogger/irclogger_log/svn-dev?date=2018-02-06#l11

* subversion/libsvn_client/info.c
  (same_resource_in_head): Search history backwards instead of forward.

Found by: jcorvel

Modified:
    subversion/trunk/subversion/libsvn_client/info.c

Modified: subversion/trunk/subversion/libsvn_client/info.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/info.c?rev=1823327&r1=1823326&r2=1823327&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/info.c (original)
+++ subversion/trunk/subversion/libsvn_client/info.c Tue Feb  6 13:44:17 2018
@@ -253,17 +253,17 @@ same_resource_in_head(svn_boolean_t *sam
                       apr_pool_t *pool)
 {
   svn_error_t *err;
-  svn_opt_revision_t start_rev, peg_rev;
+  svn_opt_revision_t operative_rev, peg_rev;
   const char *head_url;
 
-  start_rev.kind = svn_opt_revision_head;
-  peg_rev.kind = svn_opt_revision_number;
-  peg_rev.value.number = rev;
+  peg_rev.kind = svn_opt_revision_head;
+  operative_rev.kind = svn_opt_revision_number;
+  operative_rev.value.number = rev;
 
   err = svn_client__repos_locations(&head_url, NULL, NULL, NULL,
                                     ra_session,
                                     url, &peg_rev,
-                                    &start_rev, NULL,
+                                    &operative_rev, NULL,
                                     ctx, pool);
   if (err &&
       ((err->apr_err == SVN_ERR_CLIENT_UNRELATED_RESOURCES) ||


Reply via email to