From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id F2051385BF92 for ; Wed, 1 Apr 2020 19:58:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F2051385BF92 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-53-wATqN2wQOOu1Ov1Wy4xZjg-1; Wed, 01 Apr 2020 15:58:48 -0400 X-MC-Unique: wATqN2wQOOu1Ov1Wy4xZjg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CECB58017F6; Wed, 1 Apr 2020 19:58:47 +0000 (UTC) Received: from greed.delorie.com (ovpn-114-252.phx2.redhat.com [10.3.114.252]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A12D889F0A; Wed, 1 Apr 2020 19:58:47 +0000 (UTC) Received: from greed.delorie.com.redhat.com (localhost [127.0.0.1]) by greed.delorie.com (8.14.7/8.14.7) with ESMTP id 031Jwk43008369; Wed, 1 Apr 2020 15:58:46 -0400 From: DJ Delorie To: Andreas Schwab Cc: libc-alpha@sourceware.org Subject: Re: "make check" times In-Reply-To: <87imijvvbp.fsf@igel.home> (message from Andreas Schwab on Wed, 01 Apr 2020 21:51:06 +0200) Date: Wed, 01 Apr 2020 15:58:46 -0400 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-27.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2020 19:58:52 -0000 Andreas Schwab writes: > Never expand a variable unquoted. How's this? Also, comment updated to note we assume "echo" is a builtin. >From 98e461fd50f1617acc78caeaa70547b92a54cf5c Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Wed, 1 Apr 2020 15:33:00 -0400 Subject: Optimize scripts/merge-test-results.sh The inner loop is called thousands of times per "make check" even if there's otherwise nothing to do. Avoid calling /bin/head all those times when a builtin will do. diff --git a/scripts/merge-test-results.sh b/scripts/merge-test-results.sh index 573a44d8cf..e75123a730 100755 --- a/scripts/merge-test-results.sh +++ b/scripts/merge-test-results.sh @@ -35,7 +35,12 @@ case $type in subdir=3D${subdir:+$subdir/} for t in "$@"; do if [ -s "$objpfx$t.test-result" ]; then -=09head -n1 "$objpfx$t.test-result" +=09# This loop is called thousands of times even when there's +=09# nothing to do. Avoid using non-built-in commands (like +=09# /bin/head) where possible. We assume "echo" is typically a +=09# built-in. +=09read line < "$objpfx$t.test-result" +=09echo "$line" else =09echo "UNRESOLVED: $subdir$t" fi