public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hp@bitrange.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [PATCH] libstdc++ testsuite/std/ranges/iota/max_size_type.cc: Reduce /10 for simulators
Date: Fri, 29 Dec 2023 20:41:26 -0500 (EST)	[thread overview]
Message-ID: <alpine.BSF.2.20.16.2312292023350.28105@arjuna.pair.com> (raw)

I'm not completely sure I got the intent of the "log2_limit",
or whether "limit" is sane to decrease like this; it just
looked like an obvious and safe reduction.  Also, I verified
the 10+ minute runtime, on this same host (clocked at 11:43.61
elapsed time) for a r12-2797-g307e0d40367996 build that I
happened to have kept around; likely the build that led up
to that commit.  Now it's 58:45.78 elapsed time for a
successful run.  Looks like a 5x performance regression.
Worrisome; PR mentioned below.

Incidentally, a parallel build and a serial test-run takes 9
hours on that laptop, so that's almost 2 hours just for one 
test, if just updating the timeout to fit.  IOW, currently 48
minutes out of 9 hours for one test that just times out.

(That was just mentioned for comparison purposed: when suitable,
I test with `nprocs`-1 in parallel.)

I'll put it on the back-burner to investigate.  I think I'll
try to graft that version of libstdc++-v3 to this version
and see if I can shift the blame away from MMIX code
generation onto libstdc++-v3.  ;)
Or perhaps the cause is known?

With this, the test successfully completes in ~34 seconds.

Ok to commit?

-- >8 --
Looks like the MMIX port code quality and/or libstdc++
performance of this test has regressed since
r12-2799-ge9b639c4b53221 by a factor 5.  Anyway what was 11+
minutes runtime then, is now at r14-6859-gd1eacedc6d9ba9
close to 60 minutes.  Better prune the test, not just
increase timeouts.  Also of course, investigate the
performance regression, logged as PR113175.

	* testsuite/std/ranges/iota/max_size_type.cc: Adjust
	limits from -1000..1000 to -100..100 for simulators.
---
 .../std/ranges/iota/max_size_type.cc          | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc b/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc
index a1fbc3241dca..38fa6323d47e 100644
--- a/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc
+++ b/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do run { target c++20 } }
+// { dg-additional-options "-DSIMULATOR_TEST" { target simulator } }
 // { dg-timeout-factor 4 }
 
 #include <limits>
@@ -31,6 +32,14 @@ using signed_rep_t = __int128;
 using signed_rep_t = long long;
 #endif
 
+#ifdef SIMULATOR_TEST
+#define LIMIT 100
+#define LOG2_CEIL_LIMIT 7
+#else
+#define LIMIT 1000
+#define LOG2_CEIL_LIMIT 10
+#endif
+
 static_assert(sizeof(max_size_t) == sizeof(max_diff_t));
 static_assert(sizeof(rep_t) == sizeof(signed_rep_t));
 
@@ -199,8 +208,8 @@ test02()
   using max_type = std::conditional_t<signed_p, max_diff_t, max_size_t>;
   using shorten_type = std::conditional_t<shorten_p, hw_type, max_type>;
   const int hw_type_bit_size = sizeof(hw_type) * __CHAR_BIT__;
-  const int limit = 1000;
-  const int log2_limit = 10;
+  const int limit = LIMIT;
+  const int log2_limit = LOG2_CEIL_LIMIT;
   static_assert((1 << log2_limit) >= limit);
   const int min = (signed_p ? -limit : 0);
   const int max = limit;
@@ -257,8 +266,8 @@ test03()
   using max_type = std::conditional_t<signed_p, max_diff_t, max_size_t>;
   using base_type = std::conditional_t<toggle_base_p, hw_type, max_type>;
   constexpr int hw_type_bit_size = sizeof(hw_type) * __CHAR_BIT__;
-  constexpr int limit = 1000;
-  constexpr int log2_limit = 10;
+  constexpr int limit = LIMIT;
+  constexpr int log2_limit = LOG2_CEIL_LIMIT;
   static_assert((1 << log2_limit) >= limit);
   const int min = (signed_p ? -limit : 0);
   const int max = limit;
@@ -312,7 +321,7 @@ test03()
 void
 test04()
 {
-  constexpr int limit = 1000;
+  constexpr int limit = LIMIT;
   for (int i = -limit; i <= limit; i++)
     {
       VERIFY( -max_size_t(-i) == i );
-- 
2.30.2


             reply	other threads:[~2023-12-30  1:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-30  1:41 Hans-Peter Nilsson [this message]
2023-12-30  9:40 ` Jonathan Wakely
2023-12-30 18:11   ` Hans-Peter Nilsson
2023-12-31 16:56     ` Hans-Peter Nilsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.BSF.2.20.16.2312292023350.28105@arjuna.pair.com \
    --to=hp@bitrange.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).