summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-09 23:31:27 +0200
committerPaul Buetow <paul@buetow.org>2026-01-09 23:31:27 +0200
commit6eeb44837e55f237925233ae4275b6f060ebb50f (patch)
tree5856fb4ad46a42d72db0d950e0c540355e3d728a /src
parenta96d1d700731d29cfee4d4a8ead3c90aa054094d (diff)
Make cache dropping optional (--drop-caches flag)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/bench/Main.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/bench/Main.java b/src/main/java/bench/Main.java
index 0ce0f3c..a12c22b 100644
--- a/src/main/java/bench/Main.java
+++ b/src/main/java/bench/Main.java
@@ -42,6 +42,9 @@ public class Main implements Callable<Integer> {
@Option(names = {"--flush"}, description = "Call LogManager.shutdown() to flush at end of each test (default: false)")
private boolean flush = false;
+ @Option(names = {"--drop-caches"}, description = "Drop OS file caches before each test (requires sudo, default: false)")
+ private boolean dropCaches = false;
+
public static void main(String[] args) {
// Must set context selector before ANY Log4j initialization
// We'll set it dynamically per-config in BenchRunner instead
@@ -88,8 +91,10 @@ public class Main implements Callable<Integer> {
for (String configName : config.getConfigs()) {
System.out.printf("Running: %s ...%n", configName);
try {
- // Drop caches before each test
- dropCaches();
+ // Drop caches before each test if requested
+ if (dropCaches) {
+ dropCaches();
+ }
// Build command with appropriate system properties
List<String> cmd = new ArrayList<>();