starlark: run benchmarks in filename order
@@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableMap;
import com.sun.management.ThreadMXBean;
import java.io.File;
import java.lang.management.ManagementFactory;
+import java.util.Arrays;
import java.util.Map;
import java.util.TreeMap;
import java.util.regex.Pattern;
@@ -144,7 +145,9 @@ public final class Benchmarks {
src = new File("src"); // bazel
}
File testdata = new File(src, "test/java/net/starlark/java/eval/testdata");
- for (File file : testdata.listFiles()) {
+ File[] files = testdata.listFiles();
+ Arrays.sort(files); // for determinism
+ for (File file : files) {
String basename = file.getName();
if (!(basename.startsWith("bench_") && basename.endsWith(".star"))) {
continue;
