From 0c32c2133e3be1ddbc719772007ba3833d2bb848 Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Sun, 8 Mar 2015 19:21:57 -0400 Subject: Parallelized update precompiled headers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- bin/update_pch.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bin/update_pch.sh') 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/%%` -- cgit