From patchwork Sat Jun 10 04:05:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 105890 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1337741vqr; Fri, 9 Jun 2023 21:06:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6aoyIb45w+jVN7gdC+Ht/38a3KeMceJcwPOoXy1K06Ksjo7SmwLpfi/qJXJiwzBjJ/uvdT X-Received: by 2002:a17:907:d24:b0:94e:e30e:7245 with SMTP id gn36-20020a1709070d2400b0094ee30e7245mr4126448ejc.8.1686369975110; Fri, 09 Jun 2023 21:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686369975; cv=none; d=google.com; s=arc-20160816; b=FR4tUpVOJdLt6c2Ru2gV0+YAP9e+ATn+nsBJihbGyOc9JgdsV9zMgkYg8VnItNJbIu CxxtSE7/3M7iV80rriikQTXluZuTVYdTeFb0sNwxJciYtCSxtNR1sTnwBkZIWpgAHV+2 1POv+B9myPezH/3O8aJXEiK7oVtuPviRiMXc4ZOV2gIXhWgMWPtVxn8/K//Gfwvm+laS 5Dvnpg3dXQv3lKkPQMVhCLSkUKA/3KpXR2KgrgYKcFSfBtanaKKjZYB9pa0n2/XOIkvs kxl2N+3y2LIs3aaH0KAm+HECgzJApN1Z4eK/t4IRainPXgBCvMzuWegf3NTSGu3V3WiC 4AVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :references:content-transfer-encoding:mime-version:subject :in-reply-to:cc:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=gl1RypKdmbCj45d3DHcPR7NrFwWCzzup7GtzJ+ex5Bk=; b=O0pNIOsnN948tuRiB9/koe4v0Oln+UgqA9Hievju8V+IqM1ykVJM7//W1QitFuPHVv AMkXp5qztSpUKDfrdRE8zpoQMq8uw2n4+j5AyjhO9qSpqpsJs0Jkxkv9+MUSzdWAebsL UUND/xqN6VPAbayFiKvKIjhaCRRDYz1f6WHZ12eRizTMk2dXIQ8kmAxLjNzaWJ0aXgQW aSf62jsY+LFBbfK7ASa/OPdjdMhfYszFP3OHksFQQTkArwIK8D2oUeXA8/vF868ahxDk HLnDDAdk3bQ+nINZ/pUS2JWNFhFdnOxfqQKNltVnXYIDlyfL+e8luPnrEVf30gcJQB8y fmhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="Xe27DZ/n"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id bl18-20020a170906c25200b0095357b3921bsi2297719ejb.863.2023.06.09.21.06.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 21:06:15 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="Xe27DZ/n"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C1CFC3857BA4 for ; Sat, 10 Jun 2023 04:06:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C1CFC3857BA4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686369973; bh=gl1RypKdmbCj45d3DHcPR7NrFwWCzzup7GtzJ+ex5Bk=; h=To:CC:In-Reply-To:Subject:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Xe27DZ/nXCsnbSO48IHbtZEZPgZR7buQ4Wacr38oCLWdMc60zRotquwATAUzDBzSE 25JQ/RNnHcWqEcbY1ya2kpcNhnKWiCBhgNdY2FfcBAEc69/RdlGWMIQz9h/xcVCRbo Fvjxb4aSgLfSiNPe9LLui2K0LxrMKL6H5QqbdJn4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id EE5303858D35; Sat, 10 Jun 2023 04:05:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EE5303858D35 To: Jonathan Wakely CC: , In-Reply-To: (message from Jonathan Wakely on Fri, 9 Jun 2023 21:40:15 +0100) Subject: [PATCH] (Re: Splitting up 27_io/basic_istream/ignore/wchar_t/94749.cc (takes too long)) MIME-Version: 1.0 References: <20230609162026.CC34320433@pchp3.se.axis.com> Message-ID: <20230610040528.1058420420@pchp3.se.axis.com> Date: Sat, 10 Jun 2023 06:05:28 +0200 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768287083037601151?= X-GMAIL-MSGID: =?utf-8?q?1768287083037601151?= Thank you for your consideration. (Or is that phrase only used negatively?) > From: Jonathan Wakely > Date: Fri, 9 Jun 2023 21:40:15 +0100 > test01, test02, test03 and test04 should run almost instantly. On my system > they take about 5 microseconds each. So I don't think splitting those up > will help. Right. > I thought it would help to avoid re-allocating the buffer and zeroing it > again. If we reuse the same buffer, then we just have to loop until we > overflow the 32-bit counter. That would make the whole test run much > faster, which would reduce the total time for a testsuite run. Splitting > the file up into smaller files would not decrease the total time, only > decrease the time for that single test so it doesn't time out. > > I've attached a patch that does that. I makes very little difference for > me, probably because allocating zero-filled pages isn't actually expensive > on linux. Maybe it will make a differene for your simulator though? Nope, just some five seconds down (from about 10min 21s). > You could also try reducing the size of the buffer: > +#ifdef SIMULATOR_TEST > + static const streamsize bufsz = 16 << limits::digits10; > +#else > static const streamsize bufsz = 2048 << limits::digits10; > +#endif Was that supposed to be with or without the patch? Anyway; both: 606s. Only smaller bufsz: 614s. (All numbers subject to usual system jitter.) > test06 is the really slow part, that takes 10+ seconds for me. But that > entire function should already be skipped for simulators. Yep, we may have been here before... I certainly get a deja-vu feeling here, but visiting old email conversations of ours, it seems I easily conflate several similar ones. I see that here, test06 was always #ifndef SIMULATOR_TEST. > We can probably skip test05 for simulators too, none of the code it tests > is platform-specific, so as long as it's being tested on x86 we don't > really need to test it on cris-elf too. Thanks. Let's do that, then. The similar s/wchar_t/char/ test clocks in at "only" 3m30s, but I suggest treating it the same, if nothing else than for symmetry. Ok as below? -- >8 -- Subject: [PATCH] testsuite: Cut down 27_io/basic_istream/.../94749.cc for simulators The test wchar_t/94749.cc can take about 10 minutes on some simulator/host combinations with char/94749.cc at a third of that time. The cause is test05 which is quite heavy and includes wrapping a 32-bit counter. Run it only for native setups. * testsuite/27_io/basic_istream/ignore/wchar_t/94749.cc (main) [! SIMULATOR_TEST]: Also exclude running test05. * testsuite/27_io/basic_istream/ignore/char/94749.cc: Ditto. --- libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/94749.cc | 2 +- .../testsuite/27_io/basic_istream/ignore/wchar_t/94749.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/94749.cc b/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/94749.cc index 6416863983b7..9160995c05ec 100644 --- a/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/94749.cc +++ b/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/94749.cc @@ -221,8 +221,8 @@ main() test02(); test03(); test04(); - test05(); #ifndef SIMULATOR_TEST + test05(); test06(); #endif } diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/94749.cc b/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/94749.cc index 65e0a326c109..a5b9eb71a389 100644 --- a/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/94749.cc +++ b/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/94749.cc @@ -221,8 +221,8 @@ main() test02(); test03(); test04(); - test05(); #ifndef SIMULATOR_TEST + test05(); test06(); #endif }