From patchwork Thu Sep 12 12:16:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1161551 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-105168-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="dG3cddPc"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Td6f181Vz9s4Y for ; Thu, 12 Sep 2019 22:16:41 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:mime-version:content-type :message-id; q=dns; s=default; b=jGqtlVoO6hUdmBx/xzQqEcWuSiPjNTs 1ez4H7ZrYFg2mRthBnovJzBmgatFgdjAuw4aDc/OrrrBzw9naf5+3dsKonPptOwp aGOV1Y6W8SH3aUVhiEBlzPBO1mw1canvEwaivKWpapuKgy5PsiqQlP32M3GpXYsR E9sD+94jKuyo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:mime-version:content-type :message-id; s=default; bh=VhALJHyXZ+v48NnIfhQ38dElAyQ=; b=dG3cd dPcvAtcyOPnl9G1YFh3IfcQrzjHGavFcCUfhNVtaIPXTLh7mNxDPh//qrbv/Mcoj km11PZzoAljpGADwvafzkBSxPDa0niJIm/BHYi89ILnaMMcL4LeXfJsngg4zOh3H z3RcfY6rKMQtsrnyeYQ7I54OAcT7tx097f93TM= Received: (qmail 118031 invoked by alias); 12 Sep 2019 12:16:20 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 117966 invoked by uid 89); 12 Sep 2019 12:16:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1741 X-HELO: mx0a-001b2d01.pphosted.com To: GNU C Library From: Stefan Liebler Subject: [PATCH] Speedup nptl/tst-cond11 and nptl/tst-cond11-static. Date: Thu, 12 Sep 2019 14:16:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 x-cbid: 19091212-0016-0000-0000-000002AA6836 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091212-0017-0000-0000-0000330AF95F Message-Id: <4b3367a8-8aec-e9f1-46fd-7b3577d3c204@linux.ibm.com> Hi, each test runs for 5s as run_test is called 5 times. in run_test, the timeout for pthread_cond_timedwait or pthread_cond_clockwait is tested by adding 1s to current time. This patch reduces the timeout to 0.3s which leads to a runtime of 1.5s for one invocation. As the nptl tests run in sequence, this patch saves roughly 7s of runtime for "make check". Bye, Stefan ChangeLog: * nptl/tst-cond11.c (run_test): Reduce timeout. commit c7bf98b0cc862a679e876d4142e3cac84aa2d2b2 Author: Stefan Liebler Date: Thu Sep 12 10:10:35 2019 +0200 Speedup nptl/tst-cond11 and nptl/tst-cond11-static. Each test runs for 5s as run_test is called 5 times. in run_test, the timeout for pthread_cond_timedwait or pthread_cond_clockwait is tested by adding 1s to current time. This patch reduces the timeout to 0.3s which leads to a runtime of 1.5s for one invocation. As the nptl tests run in sequence, this patch saves roughly 7s of runtime for "make check". ChangeLog: * nptl/tst-cond11.c (run_test): Reduce timeout. diff --git a/nptl/tst-cond11.c b/nptl/tst-cond11.c index afb15ef66e..6d703a1607 100644 --- a/nptl/tst-cond11.c +++ b/nptl/tst-cond11.c @@ -64,8 +64,13 @@ run_test (clockid_t attr_clock, clockid_t wait_clock) xclock_gettime (wait_clock == CLOCK_USE_ATTR_CLOCK ? attr_clock : wait_clock, &ts_timeout); - /* Wait one second. */ - ++ts_timeout.tv_sec; + /* Wait 0.3 second. */ + ts_timeout.tv_nsec += 300000000; + if (ts_timeout.tv_nsec >= 1000000000) + { + ts_timeout.tv_nsec -= 1000000000; + ++ts_timeout.tv_sec; + } if (wait_clock == CLOCK_USE_ATTR_CLOCK) { TEST_COMPARE (pthread_cond_timedwait (&cond, &mut, &ts_timeout), ETIMEDOUT);