subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1605195 - /subversion/trunk/subversion/libsvn_repos/log.c
Date Tue, 24 Jun 2014 21:07:20 GMT
Author: stefan2
Date: Tue Jun 24 21:07:20 2014
New Revision: 1605195

URL: http://svn.apache.org/r1605195
Log:
Reduce the memory consumption of "svn log -v" by ~20%.

* subversion/libsvn_repos/log.c
  (detect_changed): Don't construct a copy of the CHANGES hash if possible.

Modified:
    subversion/trunk/subversion/libsvn_repos/log.c

Modified: subversion/trunk/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/log.c?rev=1605195&r1=1605194&r2=1605195&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/log.c (original)
+++ subversion/trunk/subversion/libsvn_repos/log.c Tue Jun 24 21:07:20 2014
@@ -193,9 +193,18 @@ detect_changed(apr_hash_t **changed,
   svn_boolean_t found_readable = FALSE;
   svn_boolean_t found_unreadable = FALSE;
 
-  *changed = svn_hash__make(pool);
+  /* If we create the CHANGES hash ourselves, we can reuse it as the
+   * result hash as it contains the exact same keys - but with _all_
+   * values being replaced by structs of a different type. */
   if (changes == NULL)
-    SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
+    {
+      SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
+      *changed = changes;
+    }
+  else
+    {
+      *changed = svn_hash__make(pool);
+    }
 
   if (apr_hash_count(changes) == 0)
     /* No paths changed in this revision?  Uh, sure, I guess the



Mime
View raw message