1
0

Add entry point for the timing experiments

This commit is contained in:
2026-07-26 11:46:39 +00:00
parent 49b3e67292
commit 0dcf71c0ea

View File

@@ -0,0 +1,25 @@
package com.ankurm.vectorapi;
/**
* Runs every timing experiment quoted in the article, on whatever machine you
* are sitting at. These are exploratory timings, not statistically rigorous
* benchmarks -- see the jmh/ module for the harness you would defend numbers with.
*
* javac --add-modules jdk.incubator.vector -d out $(find src -name '*.java')
* java --add-modules jdk.incubator.vector -cp out com.ankurm.vectorapi.Main
* java --add-modules jdk.incubator.vector -XX:-UseSuperWord -cp out com.ankurm.vectorapi.Main
*/
public final class Main {
public static void main(String[] args) {
int n = args.length > 0 ? Integer.parseInt(args[0]) : 8192;
Env.print();
System.out.println("array length : " + n + " floats (" + (n * 4 / 1024) + " KiB, cache-resident)");
System.out.println();
SquareAdd.run(n);
MaskedFilter.run(n);
Brightness.run(n);
ReductionOrder.run();
}
private Main() {}
}