subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1505676 - /subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c
Date Mon, 22 Jul 2013 12:27:21 GMT
Author: stefan2
Date: Mon Jul 22 12:27:20 2013
New Revision: 1505676

URL: http://svn.apache.org/r1505676
Log:
On the fsfs-improvements branch:  Speed up svn_fs_fs__paths_changed.

Since we eliminated the copyfrom_cache in r1504887 and the svn_fs
level struct is a sub-element of the FSFS change_t as of r1505671,
we don't need to call fold_change via process_changes anymore.
Instead, just create the result hash and simplify process_changes.

* subversion/libsvn_fs_fs/transaction.c
  (process_changes): drop "prefolded" as it'd be always FALSE now
  (svn_fs_fs__txn_changes_fetch): update caller
  (svn_fs_fs__paths_changed): directly build the result hash

Modified:
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c?rev=1505676&r1=1505675&r2=1505676&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c Mon Jul 22
12:27:20 2013
@@ -724,16 +724,10 @@ fold_change(apr_hash_t *changes,
 
 /* Examine all the changed path entries in CHANGES and store them in
    *CHANGED_PATHS.  Folding is done to remove redundant or unnecessary
-   *data.  Store a hash of paths to copyfrom "REV PATH" strings in
-   COPYFROM_HASH if it is non-NULL.  If PREFOLDED is true, assume that
-   the changed-path entries have already been folded (by
-   write_final_changed_path_info) and may be out of order, so we shouldn't
-   remove children of replaced or deleted directories.  Do all
-   allocations in POOL. */
+   *data. Do all allocations in POOL. */
 static svn_error_t *
 process_changes(apr_hash_t *changed_paths,
                 apr_array_header_t *changes,
-                svn_boolean_t prefolded,
                 apr_pool_t *pool)
 {
   apr_pool_t *iterpool = svn_pool_create(pool);
@@ -756,9 +750,8 @@ process_changes(apr_hash_t *changed_path
          is already a temporary subpool.
       */
 
-      if (((change->info.change_kind == svn_fs_path_change_delete)
+      if ((change->info.change_kind == svn_fs_path_change_delete)
            || (change->info.change_kind == svn_fs_path_change_replace))
-          && ! prefolded)
         {
           apr_hash_index_t *hi;
 
@@ -825,7 +818,7 @@ svn_fs_fs__txn_changes_fetch(apr_hash_t 
                                   svn_stream_from_aprfile2(file, TRUE,
                                                            scratch_pool),
                                   scratch_pool));
-  SVN_ERR(process_changes(changed_paths, changes, FALSE, pool));
+  SVN_ERR(process_changes(changed_paths, changes, pool));
   svn_pool_destroy(scratch_pool);
 
   SVN_ERR(svn_io_file_close(file, pool));
@@ -844,14 +837,17 @@ svn_fs_fs__paths_changed(apr_hash_t **ch
 {
   apr_hash_t *changed_paths;
   apr_array_header_t *changes;
-  apr_pool_t *scratch_pool = svn_pool_create(pool);
+  int i;
 
-  SVN_ERR(svn_fs_fs__get_changes(&changes, fs, rev, scratch_pool));
+  SVN_ERR(svn_fs_fs__get_changes(&changes, fs, rev, pool));
 
   changed_paths = svn_hash__make(pool);
-
-  SVN_ERR(process_changes(changed_paths, changes, TRUE, pool));
-  svn_pool_destroy(scratch_pool);
+  for (i = 0; i < changes->nelts; ++i)
+    {
+      change_t *change = APR_ARRAY_IDX(changes, i, change_t *);
+      apr_hash_set(changed_paths, change->path.data, change->path.len,
+                   &change->info);
+    }
 
   *changed_paths_p = changed_paths;
 



Mime
View raw message