tools: Parallelize ./tools/format

10x speed improvement on my 3990x machine

Change-Id: Ie4b2377719e9a25860ec05bb7649aa652d26ccf0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113022
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2022-12-06 18:29:08 +00:00
committed by Dawn LUCI CQ
parent d933470b20
commit f2b8d2b1ab
3 changed files with 36 additions and 11 deletions

View File

@@ -24,8 +24,12 @@ if ! command -v cpplint.py &> /dev/null; then
fi
FILTER="-runtime/references"
FILES="`find src/tint -type f` `find src/tint/cmd -type f`"
FILES+="`find tools/src -type f` `find src/tint/cmd -type f`"
FILES=""
FILES+="`find src/tint -type f` "
FILES+="`find src/tint/cmd -type f` "
FILES+="`find tools/src -type f` "
FILES+="`find src/tint/cmd -type f` "
# Note, there is currently no verbosity level set for cpplint.py which means
# it will use the default level of 1. This level needs to match what is in the
@@ -33,7 +37,7 @@ FILES+="`find tools/src -type f` `find src/tint/cmd -type f`"
if command -v go &> /dev/null; then
# Go is installed. Run cpplint in parallel for speed wins
go run $SCRIPT_DIR/src/cmd/run-parallel/main.go \
${SCRIPT_DIR}/run run-parallel \
--only-print-failures \
cpplint.py \
--root=$ROOT_DIR \