You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2015/06/04 14:01:43 UTC
svn commit: r1683527 -
/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentIdTableBenchmark.java
Author: thomasm
Date: Thu Jun 4 12:01:43 2015
New Revision: 1683527
URL: http://svn.apache.org/r1683527
Log:
OAK-2752 SegmentIdTable (alternative implementation with higher performance, with test case)
Modified:
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentIdTableBenchmark.java
Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentIdTableBenchmark.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentIdTableBenchmark.java?rev=1683527&r1=1683526&r2=1683527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentIdTableBenchmark.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentIdTableBenchmark.java Thu Jun 4 12:01:43 2015
@@ -109,8 +109,11 @@ public class SegmentIdTableBenchmark {
return id;
}
}
+ // guaranteed to work for power of 2 table sizes, see
+ // http://stackoverflow.com/questions/2348187/moving-from-linear-probing-to-quadratic-probing-hash-collisons
+ // http://stackoverflow.com/questions/12121217/limit-for-quadratic-probing-a-hash-table
index = (index + increment) & (length - 1);
- increment += increment;
+ increment++;
if (increment > 100) {
System.out.println("inc " + increment);
}