diff --git a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh index e12d5f231e6..ee626abdd84 100755 --- a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh +++ b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh @@ -24,6 +24,9 @@ GLOB="*.h *.c *.cc *.m *.mm" # clang format command CLANG_FORMAT=${CLANG_FORMAT:-clang-format} +# number of CPUs available +CPU_COUNT=`nproc` + files= for dir in $DIRS do @@ -41,7 +44,7 @@ fi if [ "$TEST" == "" ] then - echo $files | xargs $CLANG_FORMAT -i + echo $files | xargs -P $CPU_COUNT -n 10 $CLANG_FORMAT -i else ok=yes for file in $files