From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Hans-Peter Nilsson <hp@axis.com>
Cc: Jonathan Wakely <jwakely@redhat.com>,
"libstdc++" <libstdc++@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] (Re: Splitting up 27_io/basic_istream/ignore/wchar_t/94749.cc (takes too long))
Date: Sat, 10 Jun 2023 08:12:45 +0100 [thread overview]
Message-ID: <CAH6eHdQi5WVfuocXZqGZLZYQLspJXdJbK=qXgxAGd98hJ+2G2A@mail.gmail.com> (raw)
In-Reply-To: <20230610040528.1058420420@pchp3.se.axis.com>
[-- Attachment #1: Type: text/plain, Size: 4218 bytes --]
On Sat, 10 Jun 2023, 06:18 Hans-Peter Nilsson via Libstdc++, <
libstdc++@gcc.gnu.org> wrote:
> Thank you for your consideration. (Or is that phrase only used
> negatively?)
>
> > From: Jonathan Wakely <jwakely@redhat.com>
> > 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).
>
Bah, worth a try :)
> > 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?
>
OK for trunk, and all branches you care about.
> -- >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
> }
> --
> 2.30.2
>
>
prev parent reply other threads:[~2023-06-10 7:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 16:20 Splitting up 27_io/basic_istream/ignore/wchar_t/94749.cc (takes too long) Hans-Peter Nilsson
2023-06-09 17:18 ` Mike Stump
2023-06-09 17:49 ` Hans-Peter Nilsson
2023-06-09 21:47 ` Bernhard Reutner-Fischer
2023-06-10 18:29 ` Mike Stump
2023-06-12 8:35 ` Bernhard Reutner-Fischer
2023-06-12 22:26 ` Mike Stump
2023-06-09 20:40 ` Jonathan Wakely
2023-06-10 4:05 ` [PATCH] (Re: Splitting up 27_io/basic_istream/ignore/wchar_t/94749.cc (takes too long)) Hans-Peter Nilsson
2023-06-10 7:12 ` Jonathan Wakely [this message]
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='CAH6eHdQi5WVfuocXZqGZLZYQLspJXdJbK=qXgxAGd98hJ+2G2A@mail.gmail.com' \
--to=jwakely.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hp@axis.com \
--cc=jwakely@redhat.com \
--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).