You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/06/24 22:57:29 UTC

svn commit: r1605189 - /subversion/trunk/subversion/libsvn_fs_fs/low_level.c

Author: stefan2
Date: Tue Jun 24 20:57:29 2014
New Revision: 1605189

URL: http://svn.apache.org/r1605189
Log:
* subversion/libsvn_fs_fs/low_level.c
  (svn_fs_fs__read_changes): Fine-tune result buffer pre-allocation strategy.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/low_level.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/low_level.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/low_level.c?rev=1605189&r1=1605188&r2=1605189&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/low_level.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/low_level.c Tue Jun 24 20:57:29 2014
@@ -389,9 +389,15 @@ svn_fs_fs__read_changes(apr_array_header
   change_t *change;
   apr_pool_t *iterpool;
 
-  /* pre-allocate enough room for most change lists
-     (will be auto-expanded as necessary) */
-  *changes = apr_array_make(result_pool, 30, sizeof(change_t *));
+  /* Pre-allocate enough room for most change lists.
+     (will be auto-expanded as necessary).
+
+     Chose the default to just below 2^N such that the doubling reallocs
+     will request roughly 2^M bytes from the OS without exceeding the
+     respective two-power by just a few bytes (leaves room array and APR
+     node overhead for large enough M).
+   */
+  *changes = apr_array_make(result_pool, 63, sizeof(change_t *));
 
   SVN_ERR(read_change(&change, stream, result_pool, scratch_pool));
   iterpool = svn_pool_create(scratch_pool);