diff --git a/src/main/java/com/github/fabienrenaud/jjb/Cli.java b/src/main/java/com/github/fabienrenaud/jjb/Cli.java index 7cc900d..97c5bb5 100644 --- a/src/main/java/com/github/fabienrenaud/jjb/Cli.java +++ b/src/main/java/com/github/fabienrenaud/jjb/Cli.java @@ -55,8 +55,8 @@ public static abstract class AbstractCommand implements Runnable { public int measurementIterations = 10; @Option(type = OptionType.GLOBAL, name = "-m", description = "JMH: measurement time in seconds. Defaults to 3.") public int measurementTime = 3; - @Option(type = OptionType.GLOBAL, name = "-t", description = "JMH: number of threads. Defaults to 16.") - public int threads = 16; + @Option(type = OptionType.GLOBAL, name = "-t", description = "JMH: number of threads. Defaults to number of cores-1.") + public int threads = Math.max(Runtime.getRuntime().availableProcessors() - 1, 1); /* * JSON options