From patchwork Tue Apr 19 02:13:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 91906 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id A622FB6EF0 for ; Tue, 19 Apr 2011 12:13:37 +1000 (EST) Received: (qmail 29274 invoked by alias); 19 Apr 2011 02:13:32 -0000 Received: (qmail 29253 invoked by uid 22791); 19 Apr 2011 02:13:30 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from anubis.se.axis.com (HELO anubis.se.axis.com) (195.60.68.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Apr 2011 02:13:13 +0000 Received: from localhost (localhost [127.0.0.1]) by anubis.se.axis.com (Postfix) with ESMTP id 5DA3119D8B; Tue, 19 Apr 2011 04:13:10 +0200 (CEST) Received: from anubis.se.axis.com ([127.0.0.1]) by localhost (anubis.se.axis.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8puBpqNqB3ff; Tue, 19 Apr 2011 04:13:09 +0200 (CEST) Received: from thoth.se.axis.com (thoth.se.axis.com [10.0.2.173]) by anubis.se.axis.com (Postfix) with ESMTP id 9AA0A19D8A; Tue, 19 Apr 2011 04:13:09 +0200 (CEST) Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.88.21.50]) by thoth.se.axis.com (Postfix) with ESMTP id 88DC5341F4; Tue, 19 Apr 2011 04:13:09 +0200 (CEST) Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id p3J2D9F6019087; Tue, 19 Apr 2011 04:13:09 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id p3J2D9x6019083; Tue, 19 Apr 2011 04:13:09 +0200 Date: Tue, 19 Apr 2011 04:13:09 +0200 Message-Id: <201104190213.p3J2D9x6019083@ignucius.se.axis.com> From: Hans-Peter Nilsson To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Fix PR48675: 20_util/hash/chi2_quality.cc timeout for simulator targets MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org See PR48675 for details. It also mentions a secondary issue, a performance regression introduced in 172607:172613 after an improvement introduced in 172417:172431. If you look at the test, it has this nice line, // { dg-options "-std=gnu++0x -DSAMPLES=10000" { target simulator } } (the default SAMPLES being 300000), which makes you think that it's all parametrized to not time-out for runs on a simulator. That SAMPLES value is actually the lowest limit; if you lower that number, the test will actually fail with an assert at line 101! Anyway, the remaining dominating part of the test isn't parametrized at all (neither rightly or wrongly), as seen in the patch. With the patch applied, the test runs in about 30 seconds. Without the patch, the test runs for 620..630 seconds, and so times out with the testsuite harness timeout of 600 seconds. Considering that this test is just a part of a generic test, I don't see much point in trying to parametrize it; better to just skip it for low SAMPLES values. With the default SAMPLES being 300000 and the file being 187587 lines (words), it seems appropriate to put the limit at SAMPLES < 100000. I have not looked further for similar test issues. Ok to commit, trunk as well as older branches? libstdc++-v3: * testsuite/20_util/hash/chi2_quality.cc (test_document_words): Stub this part if SAMPLES < 100000. brgds, H-P Index: testsuite/20_util/hash/chi2_quality.cc =================================================================== --- testsuite/20_util/hash/chi2_quality.cc (revision 172667) +++ testsuite/20_util/hash/chi2_quality.cc (working copy) @@ -183,6 +183,10 @@ test_bit_string_set() void test_document_words() { + // That file is 187587 single-word lines. To avoid a timeout, just skip + // this part, which would take up to 95% of the program runtime (with + // SAMPLES == 10000), if we're not supposed to run anywhere that long. +#if SAMPLES >= 100000 bool test __attribute__((unused)) = true; const std::string f_name = "thirty_years_among_the_dead_preproc.txt"; std::ifstream in(f_name); @@ -199,6 +203,7 @@ test_document_words() const unsigned long k = words.size() / 20; double chi2 = chi2_hash(words, k); VERIFY( chi2 < k*1.1 ); +#endif } int