MCPcopy Create free account
hub / github.com/e2wugui/zeze / randKey

Method randKey

ZezeJava/ZezeJavaTest/src/Benchmark/Simulate.java:51–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 private static Table5 table5;
50
51 private static long randKey() {
52 var rand = ThreadLocalRandom.current();
53 if (rand.nextInt(100) >= localPercent)
54 return rand.nextLong(totalKeyRange);
55 var k = keyWindowBegin.get() + rand.nextInt(localKeyWindow);
56 if (k >= keyEnd)
57 k -= localKeyWindow;
58 return k;
59 }
60
61 private static long read1() {
62 var k = randKey();

Callers 4

read1Method · 0.95
readWrite1Method · 0.95
read2Write1Method · 0.95
readWrite2Method · 0.95

Calls 4

currentMethod · 0.80
getMethod · 0.65
nextIntMethod · 0.45
nextLongMethod · 0.45

Tested by

no test coverage detected