Skip to content

Commit

Permalink
Fixup apache#111 Document the number of utilized cores and use 1 core…
Browse files Browse the repository at this point in the history
… at least
  • Loading branch information
ppalaga committed Oct 21, 2020
1 parent 1b18bd4 commit f77ffeb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ This architecture brings the following advantages:

`mvnd` brings the following features on top of the stock Maven:

* `-T1C` is used by default. This means builing in parallel using as many threads as CPU cores on your machine. If your
source tree does not support parallel builds, pass `-T1` on the command line to make your build serial.
* By default, `mvnd` is building your modules in parallel using multiple CPU cores. The number of utilized cores is
given by the formula `Math.max(Runtime.getRuntime().availableProcessors() - 1, 1)`. If your source tree does not
support parallel builds, pass `-T1` on the command line to make your build serial.
* Improved console output: we believe that the output of a parallel build on a stock Maven is hard to follow. Therefore,
we implemented a simplified a non-rolling view showing the status of each build thread on a separate line. This is
what it looks like on a machine with 24 cores:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public ExecutionResult execute(ClientOutput output, List<String> argv) {

static void setDefaultArgs(List<String> args) {
if (args.stream().noneMatch(arg -> arg.startsWith("-T") || arg.equals("--threads"))) {
int procs = Runtime.getRuntime().availableProcessors() - 1;
final int procs = Math.max(Runtime.getRuntime().availableProcessors() - 1, 1);
args.add("-T" + procs);
}
if (args.stream().noneMatch(arg -> arg.startsWith("-b") || arg.equals("--builder"))) {
Expand Down

0 comments on commit f77ffeb

Please sign in to comment.