runAllBenchmarksWithRandomDistribution(1024, 10000000);
}
private static void runAllBenchmarksWithZipfDistribution(int capacity, int round) {
// skew 1.0
ZipfGenerator zipf1 = new ZipfGenerator(2.0d);
long[] data = new long[round];
for(int i = 0; i < round; i++) {
data[i] = Math.abs(zipf1.nextLong()) % round;
}
runBenchmarkWithZipfDistribution(capacity, round, 1.0, data, ReplacementAlgorithm.GClockK);
runBenchmarkWithZipfDistribution(capacity, round, 1.0, data, ReplacementAlgorithm.GClock);
runBenchmarkWithZipfDistribution(capacity, round, 1.0, data, ReplacementAlgorithm.LRU);
// skew 0.8
ZipfGenerator zipf2 = new ZipfGenerator(1.8d);
for(int i = 0; i < round; i++) {
data[i] = Math.abs(zipf2.nextLong()) % round;
}
runBenchmarkWithZipfDistribution(capacity, round, 0.8, data, ReplacementAlgorithm.GClockK);
runBenchmarkWithZipfDistribution(capacity, round, 0.8, data, ReplacementAlgorithm.GClock);
runBenchmarkWithZipfDistribution(capacity, round, 0.8, data, ReplacementAlgorithm.LRU);
// skew 0.5
ZipfGenerator zipf3 = new ZipfGenerator(1.5d);
for(int i = 0; i < round; i++) {
data[i] = Math.abs(zipf3.nextLong()) % round;
}
runBenchmarkWithZipfDistribution(capacity, round, 0.5, data, ReplacementAlgorithm.GClockK);
runBenchmarkWithZipfDistribution(capacity, round, 0.5, data, ReplacementAlgorithm.GClock);
runBenchmarkWithZipfDistribution(capacity, round, 0.5, data, ReplacementAlgorithm.LRU);
}