Skip to content

Commit c2661e8

Browse files
authored
Parallelise format-all.sh script (#1341)
By processing each file in parallel we can make the formatting operation faster. Benchmarked with `time scripts/format-all.sh`: | | `total` | |-------- |--------- | | Before | `1.892` | | After | `0.871` |
1 parent 2ca45d4 commit c2661e8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/format-all.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@
66

77
find hazelcast/generated-sources hazelcast/include hazelcast/src hazelcast/test/src examples \
88
| grep -E '\.(cpp|h)$' \
9-
| xargs clang-format -i
9+
| while read -r file; do {
10+
clang-format -i "${file}"
11+
} &
12+
done
13+
14+
wait

0 commit comments

Comments
 (0)