[Libreoffice-commits] core.git: bin/update_pch.sh

Ashod Nakashian ashodnakashian at yahoo.com
Fri Apr 3 00:29:09 PDT 2015


 bin/update_pch.sh |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit 0c32c2133e3be1ddbc719772007ba3833d2bb848
Author: Ashod Nakashian <ashodnakashian at yahoo.com>
Date:   Sun Mar 8 19:21:57 2015 -0400

    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 at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/bin/update_pch.sh b/bin/update_pch.sh
index 61f0c6d..9f423d6 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/%%`


More information about the Libreoffice-commits mailing list