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/03/07 23:25:15 UTC
svn commit: r1575433 -
/subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
Author: stefan2
Date: Fri Mar 7 22:25:15 2014
New Revision: 1575433
URL: http://svn.apache.org/r1575433
Log:
* subversion/libsvn_subr/cache-membuffer.c
(get_group_index): Tune the key->bucket mapping function to distribute
cached objects more evenly across the segments.
Modified:
subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
Modified: subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cache-membuffer.c?rev=1575433&r1=1575432&r2=1575433&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cache-membuffer.c Fri Mar 7 22:25:15 2014
@@ -1093,10 +1093,10 @@ get_group_index(svn_membuffer_t **cache,
/* select the cache segment to use. they have all the same group_count.
* Since key may not be well-distributed, pre-fold it to a smaller but
- * "denser" ranger. The divisors are primes larger than the largest
+ * "denser" ranger. The modulus is a prime larger than the largest
* counts. */
- *cache = &segment0[(key[1] % APR_UINT64_C(2809637))
- & (segment0->segment_count - 1)];
+ *cache = &segment0[(key[1] % APR_UINT64_C(2809637) + (key[0] / 37))
+ & (segment0->segment_count - 1)];
return (key[0] % APR_UINT64_C(5030895599)) % segment0->group_count;
}