in AsynchronousRatchetingTree/src/main/java/com/facebook/research/asynchronousratchetingtree/Main.java [27:81]
public static void main(String[] args) {
checkForUnlimitedStrengthCrypto();
// Run a test run first to warm up the JIT
artTestRun(8, 8);
dhTestRun(8, 8);
List<TestResult> artResults = new LinkedList<>();
List<TestResult> dhResults = new LinkedList<>();
int test_size_limit = 1000;
double multiplier = 1.5;
// First run ART tests. Warm up the JIT with a few smallish values, and then start recording results.
for (int i = 2; i < 20; i += 2) {
artTestRun(i, i);
}
int lastNumber = 1;
for (double i = 2.0; i <= test_size_limit; i *= multiplier) {
int n = (int) i;
if (n == lastNumber) {
continue;
}
lastNumber = n;
System.gc();
artResults.add(artTestRun(n, n));
}
// Now run DH tests. Again, warm up the JIT with a few smallish values, and then start recording results.
for (int i = 2; i < 20; i += 2) {
dhTestRun(i, i);
}
lastNumber = 1;
for (double i = 2.0; i <= test_size_limit; i *= multiplier) {
int n = (int) i;
if (n == lastNumber) {
continue;
}
System.gc();
dhResults.add(dhTestRun(n, n));
}
TestResult.outputHeaderLine();
Iterator<TestResult> artIterator = artResults.iterator();
while (artIterator.hasNext()) {
TestResult r = artIterator.next();
r.output();
}
Iterator<TestResult> dhIterator = dhResults.iterator();
while (dhIterator.hasNext()) {
TestResult r = dhIterator.next();
r.output();
}
}