summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAshod Nakashian <ashodnakashian@yahoo.com>2015-03-08 19:21:57 -0400
committerCaolán McNamara <caolanm@redhat.com>2015-04-03 07:28:43 +0000
commit0c32c2133e3be1ddbc719772007ba3833d2bb848 (patch)
tree6953b260d82913447950217d965c57bb4cd713b0 /bin
parentbdff04c635f9b65485f6a5a79116699cb1e82d72 (diff)
Parallelized update precompiled headers.
Each pch file is updated independently from the others, giving an opportunity to execute the update logic in parallel. The script uses xargs to run the update script in parallel. The total execution on my particular rig was reduced from ~420 minutes to under 75 mins, using 24 threads on Evo 850 SSD. Change-Id: Ifeb3947e756325756eb786e3025155481da1ea41 Reviewed-on: https://gerrit.libreoffice.org/14802 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/update_pch.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/update_pch.sh b/bin/update_pch.sh
index 61f0c6d74e25..9f423d643d00 100755
--- a/bin/update_pch.sh
+++ b/bin/update_pch.sh
@@ -8,6 +8,7 @@
#
# Usage: update_pch.sh [precompiled_xxx.hxx]
+# Invoke: make cmd cmd="./bin/update_pch.sh [..]"
root=`dirname $0`
root=`cd $root/.. && pwd`
@@ -18,6 +19,17 @@ else
headers="$1"
fi
+# Split the headers into an array.
+IFS=' ' read -a aheaders <<< $headers
+hlen=${#aheaders[@]};
+if [ $hlen -gt 1 ]; then
+ if [ -z "$PARALLELISM" ]; then
+ PARALLELISM=0 # Let xargs decide
+ fi
+ echo $headers | xargs -n 1 -P $PARALLELISM $0
+ exit $?
+fi
+
for x in $headers; do
header=$x
echo updating `echo $header | sed -e s%$root/%%`