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

[PATCH] Optimize away HEAD requests during 'svn import' and certain commits in ra_serf

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2007-06-12 22:04:23 CEST

Justin, here's the patch I think you were suggesting in IRC today. It
consistently shaves about 15% off the cost of a remote 'svn import' of the
ViewVC tree in my testing. I've not run it through the test suite yet,
though (would do so before committing, but need to go AFK for now).

<<<
Optimize away HEAD requests during 'svn import' and certain commits
in ra_serf.

* subversion/libsvn_ra_serf/commit.c
  (add_file): Don't send a HEAD request to make sure a to-be-added
    file doesn't already exist if this commit created the parent
    directory.

Suggested by: jerenkrantz
>>>

Index: subversion/libsvn_ra_serf/commit.c
===================================================================
--- subversion/libsvn_ra_serf/commit.c (revision 25380)
+++ subversion/libsvn_ra_serf/commit.c (working copy)
@@ -1396,11 +1396,13 @@
   new_file->changed_props = apr_hash_make(new_file->pool);
   new_file->removed_props = apr_hash_make(new_file->pool);

- /* Ensure that the file doesn't exist by doing a HEAD on the resource -
- * only if we haven't deleted it in this commit already.
+ /* Ensure that the file doesn't exist by doing a HEAD on the
+ * resource, but only if we haven't deleted it in this commit
+ * already, or if the parent directory is also new to this commit.
    */
- if (!apr_hash_get(dir->commit->deleted_entries,
- new_file->name, APR_HASH_KEY_STRING))
+ if (SVN_IS_VALID_REVNUM(dir->base_revision)
+ && (!apr_hash_get(dir->commit->deleted_entries,
+ new_file->name, APR_HASH_KEY_STRING)))
     {
       svn_ra_serf__simple_request_context_t *head_ctx;
       svn_ra_serf__handler_t *handler;

-- 
C. Michael Pilato <cmpilato@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on Tue Jun 12 22:04:39 2007

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.