Faster clang-format (#28086)

* use parallelism to speed clang-format performance

* use parallelism to speed clang-format performance
pull/28110/head
Craig Tiller 3 years ago committed by GitHub
parent 89d08dad9d
commit 6001ea84b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      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 command
CLANG_FORMAT=${CLANG_FORMAT:-clang-format} CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
# number of CPUs available
CPU_COUNT=`nproc`
files= files=
for dir in $DIRS for dir in $DIRS
do do
@ -41,7 +44,7 @@ fi
if [ "$TEST" == "" ] if [ "$TEST" == "" ]
then then
echo $files | xargs $CLANG_FORMAT -i echo $files | xargs -P $CPU_COUNT -n 10 $CLANG_FORMAT -i
else else
ok=yes ok=yes
for file in $files for file in $files

Loading…
Cancel
Save