This saves many seconds per run.
Note that some implementations of xargs might not accept the `-P`
option, therefore `tools/format-cpp` now requires something like
GNU xargs.
`nproc` is also a GNU (Coreutils) thing.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ie7113dae32cff506b716c3b590bbe58eac5f1586
Reviewed-on: https://review.lttng.org/c/babeltrace/+/9950
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
find "$root_dir" \( -name '*.cpp' -o -name '*.hpp' \) \
! -wholename '*/cpp-common/optional.hpp' \
! -wholename '*/cpp-common/string_view.hpp' \
find "$root_dir" \( -name '*.cpp' -o -name '*.hpp' \) \
! -wholename '*/cpp-common/optional.hpp' \
! -wholename '*/cpp-common/string_view.hpp' \
- -print0 | xargs -n1 -0 $formatter
+ -print0 | xargs -P$(nproc) -n1 -0 $formatter
}
if [[ -n "$FORMATTER" ]]; then
}
if [[ -n "$FORMATTER" ]]; then