Author: stefan2
Date: Mon Sep 28 10:16:12 2015
New Revision: 1705646
URL: http://svn.apache.org/viewvc?rev=1705646&view=rev
Log:
Tune reorg strategy during the FSFS format7 packs such that it favors
checkout-style tree walks now.
Since r1703237, following the log history no longer requires frequent
access to directory data but mainly relies on noderev predecessor chain.
Therefore, it is no longer necessary to tightly pack directories in a
separate part of the pack file. With this patch, they are now placed
with the file contents and can be processed by a quasi-linear scan
instead of reading from two sections per pack.
* subversion/libsvn_fs_fs/pack.c
(compare_dir_entries_format7): Adapt reporting strategy - process dirs
at the same time as files now.
(compare_is_dir): No longer needed.
(sort_reps): No longer distinguish between file and dir reps but only
paths and delta chains when determining reprentation order.
Modified:
subversion/trunk/subversion/libsvn_fs_fs/pack.c
Modified: subversion/trunk/subversion/libsvn_fs_fs/pack.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/pack.c?rev=1705646&r1=1705645&r2=1705646&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/pack.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/pack.c Mon Sep 28 10:16:12 2015
@@ -610,9 +610,6 @@ compare_dir_entries_format7(const svn_so
const svn_fs_dirent_t *lhs = (const svn_fs_dirent_t *) a->value;
const svn_fs_dirent_t *rhs = (const svn_fs_dirent_t *) b->value;
- if (lhs->kind != rhs->kind)
- return lhs->kind == svn_node_dir ? -1 : 1;
-
return strcmp(lhs->name, rhs->name);
}
@@ -810,15 +807,6 @@ compare_ref_to_item(const reference_t *
return svn_fs_fs__id_part_compare(&(*lhs_p)->from, rhs_p);
}
-/* implements compare_fn_t. Finds the DIR / FILE boundary.
- */
-static int
-compare_is_dir(const path_order_t * const * lhs_p,
- const void *unused)
-{
- return (*lhs_p)->is_dir ? -1 : 0;
-}
-
/* Look for the least significant bit set in VALUE and return the smallest
* number with the same property, i.e. the largest power of 2 that is a
* factor in VALUE. */
@@ -966,7 +954,7 @@ sort_reps(pack_context_t *context)
{
apr_pool_t *temp_pool;
const path_order_t **temp, **path_order;
- int i, count, dir_count;
+ int i, count;
/* We will later assume that there is at least one node / path.
*/
@@ -991,13 +979,8 @@ sort_reps(pack_context_t *context)
temp = apr_pcalloc(temp_pool, count * sizeof(*temp));
path_order = (void *)context->path_order->elts;
- /* Find the boundary between DIR and FILE section. */
- dir_count = svn_sort__bsearch_lower_bound(context->path_order, NULL,
- (int (*)(const void *, const void *))compare_is_dir);
-
/* Sort those sub-sections separately. */
- sort_reps_range(context, path_order, temp, 0, dir_count);
- sort_reps_range(context, path_order, temp, dir_count, count);
+ sort_reps_range(context, path_order, temp, 0, count);
/* We now know the final ordering. */
for (i = 0; i < count; ++i)