Author: delphij
Date: Mon Jun 29 19:02:30 2015
New Revision: 284939
URL: https://svnweb.freebsd.org/changeset/base/284939

Log:
  MFC r256594 (cperciva):
  
  Speed up `freebsd-update IDS` by using IFS to split fields instead of
  forking lots of processes to run echo|cut.  In one test this reduced
  the CPU time from 980s to 134s and the wallclock time from 806s to
  132s.
  
  Submitted by: Oleg Ginzburg

Modified:
  stable/10/usr.sbin/freebsd-update/freebsd-update.sh
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/freebsd-update/freebsd-update.sh
==============================================================================
--- stable/10/usr.sbin/freebsd-update/freebsd-update.sh Mon Jun 29 18:56:53 
2015        (r284938)
+++ stable/10/usr.sbin/freebsd-update/freebsd-update.sh Mon Jun 29 19:02:30 
2015        (r284939)
@@ -3099,21 +3099,8 @@ IDS_compare () {
        mv INDEX-NOTMATCHING.tmp INDEX-NOTMATCHING
 
        # Go through the lines and print warnings.
-       while read LINE; do
-               FPATH=`echo "${LINE}" | cut -f 1 -d '|'`
-               TYPE=`echo "${LINE}" | cut -f 2 -d '|'`
-               OWNER=`echo "${LINE}" | cut -f 3 -d '|'`
-               GROUP=`echo "${LINE}" | cut -f 4 -d '|'`
-               PERM=`echo "${LINE}" | cut -f 5 -d '|'`
-               HASH=`echo "${LINE}" | cut -f 6 -d '|'`
-               LINK=`echo "${LINE}" | cut -f 7 -d '|'`
-               P_TYPE=`echo "${LINE}" | cut -f 8 -d '|'`
-               P_OWNER=`echo "${LINE}" | cut -f 9 -d '|'`
-               P_GROUP=`echo "${LINE}" | cut -f 10 -d '|'`
-               P_PERM=`echo "${LINE}" | cut -f 11 -d '|'`
-               P_HASH=`echo "${LINE}" | cut -f 12 -d '|'`
-               P_LINK=`echo "${LINE}" | cut -f 13 -d '|'`
-
+       local IFS='|'
+       while read FPATH TYPE OWNER GROUP PERM HASH LINK P_TYPE P_OWNER P_GROUP 
P_PERM P_HASH P_LINK; do
                # Warn about different object types.
                if ! [ "${TYPE}" = "${P_TYPE}" ]; then
                        echo -n "${FPATH} is a "
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to