public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] c++/modules testsuite: avoid expensive ggc-min-expand=0
@ 2024-04-23 18:28 Patrick Palka
  2024-04-23 20:02 ` Jason Merrill
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Palka @ 2024-04-23 18:28 UTC (permalink / raw)
  To: gcc-patches; +Cc: jason, Patrick Palka

Tested on x86_64-pc-linux-gnu, does this look OK for trunk?

-- >8 --

The below testcase uses --param=ggc-min-expand=0 which forces a full GC
during every collection point and in turn takes over two minutes to run
and ends up being the main bottleneck of the modules.exp testsuite.

This patch speeds up this test without (hopefully) significantly affecting
its coverage by using =1 instead of =0 which forces a full GC each time the
heap grows by 1%, which means exponentially fewer GCs.  After this patch
the modules.exp testsuite finishes in 2m55s instead of 3m40s with -j8 on
my machine.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/pr99023_a.X: Use ggc-min-expand=1 instead of =0.
	* g++.dg/modules/pr99023_b.X: Likewise.
---
 gcc/testsuite/g++.dg/modules/pr99023_a.X | 2 +-
 gcc/testsuite/g++.dg/modules/pr99023_b.X | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/g++.dg/modules/pr99023_a.X b/gcc/testsuite/g++.dg/modules/pr99023_a.X
index c872d15f792..96bb4a2ab5a 100644
--- a/gcc/testsuite/g++.dg/modules/pr99023_a.X
+++ b/gcc/testsuite/g++.dg/modules/pr99023_a.X
@@ -1,5 +1,5 @@
 // PR c++/99023, ICE
-// { dg-additional-options {-x c++-system-header initializer_list -fmodules-ts --param ggc-min-expand=0} }
+// { dg-additional-options {-x c++-system-header initializer_list -fmodules-ts --param ggc-min-expand=1} }
 
 // { dg-prune-output {linker input file unused} }
 
diff --git a/gcc/testsuite/g++.dg/modules/pr99023_b.X b/gcc/testsuite/g++.dg/modules/pr99023_b.X
index ca5f32e5bcc..955378ad88f 100644
--- a/gcc/testsuite/g++.dg/modules/pr99023_b.X
+++ b/gcc/testsuite/g++.dg/modules/pr99023_b.X
@@ -1,5 +1,5 @@
 // PR c++/99023, ICE
-// { dg-additional-options {-x c++-system-header iostream -fmodules-ts -flang-info-include-translate=<initializer_list> --param ggc-min-expand=0} }
+// { dg-additional-options {-x c++-system-header iostream -fmodules-ts -flang-info-include-translate=<initializer_list> --param ggc-min-expand=1} }
 
 // { dg-prune-output {linker input file unused} }
 
-- 
2.45.0.rc0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] c++/modules testsuite: avoid expensive ggc-min-expand=0
  2024-04-23 18:28 [PATCH] c++/modules testsuite: avoid expensive ggc-min-expand=0 Patrick Palka
@ 2024-04-23 20:02 ` Jason Merrill
  2024-04-24 12:49   ` Patrick Palka
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Merrill @ 2024-04-23 20:02 UTC (permalink / raw)
  To: Patrick Palka, gcc-patches

On 4/23/24 11:28, Patrick Palka wrote:
> Tested on x86_64-pc-linux-gnu, does this look OK for trunk?

Is the test being run for multiple standard levels?  I'd rather restrict 
it to one and keep fully testing GC-safety.

> -- >8 --
> 
> The below testcase uses --param=ggc-min-expand=0 which forces a full GC
> during every collection point and in turn takes over two minutes to run
> and ends up being the main bottleneck of the modules.exp testsuite.
> 
> This patch speeds up this test without (hopefully) significantly affecting
> its coverage by using =1 instead of =0 which forces a full GC each time the
> heap grows by 1%, which means exponentially fewer GCs.  After this patch
> the modules.exp testsuite finishes in 2m55s instead of 3m40s with -j8 on
> my machine.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* g++.dg/modules/pr99023_a.X: Use ggc-min-expand=1 instead of =0.
> 	* g++.dg/modules/pr99023_b.X: Likewise.
> ---
>   gcc/testsuite/g++.dg/modules/pr99023_a.X | 2 +-
>   gcc/testsuite/g++.dg/modules/pr99023_b.X | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/testsuite/g++.dg/modules/pr99023_a.X b/gcc/testsuite/g++.dg/modules/pr99023_a.X
> index c872d15f792..96bb4a2ab5a 100644
> --- a/gcc/testsuite/g++.dg/modules/pr99023_a.X
> +++ b/gcc/testsuite/g++.dg/modules/pr99023_a.X
> @@ -1,5 +1,5 @@
>   // PR c++/99023, ICE
> -// { dg-additional-options {-x c++-system-header initializer_list -fmodules-ts --param ggc-min-expand=0} }
> +// { dg-additional-options {-x c++-system-header initializer_list -fmodules-ts --param ggc-min-expand=1} }
>   
>   // { dg-prune-output {linker input file unused} }
>   
> diff --git a/gcc/testsuite/g++.dg/modules/pr99023_b.X b/gcc/testsuite/g++.dg/modules/pr99023_b.X
> index ca5f32e5bcc..955378ad88f 100644
> --- a/gcc/testsuite/g++.dg/modules/pr99023_b.X
> +++ b/gcc/testsuite/g++.dg/modules/pr99023_b.X
> @@ -1,5 +1,5 @@
>   // PR c++/99023, ICE
> -// { dg-additional-options {-x c++-system-header iostream -fmodules-ts -flang-info-include-translate=<initializer_list> --param ggc-min-expand=0} }
> +// { dg-additional-options {-x c++-system-header iostream -fmodules-ts -flang-info-include-translate=<initializer_list> --param ggc-min-expand=1} }
>   
>   // { dg-prune-output {linker input file unused} }
>   


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] c++/modules testsuite: avoid expensive ggc-min-expand=0
  2024-04-23 20:02 ` Jason Merrill
@ 2024-04-24 12:49   ` Patrick Palka
  2024-04-24 13:59     ` Jason Merrill
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Palka @ 2024-04-24 12:49 UTC (permalink / raw)
  To: Jason Merrill; +Cc: Patrick Palka, gcc-patches

On Tue, 23 Apr 2024, Jason Merrill wrote:

> On 4/23/24 11:28, Patrick Palka wrote:
> > Tested on x86_64-pc-linux-gnu, does this look OK for trunk?
> 
> Is the test being run for multiple standard levels?  I'd rather restrict it to
> one and keep fully testing GC-safety.

Ah yeah, looks like it runs three times by default, in C++17, C++20 and
C++23 mode.  Like so?  The speedup is almost as good as using
ggc-min-expand=1.

Interestingly, restricting to one standard level _and_ using
ggc-min-expand=1 does not give further speedup.

-- >8 --

Subject: [PATCH] c++/modules testsuite: restrict expensive pr99023 test

The pr99023 testcase uses --param=ggc-min-expand=0 which forces a GC
during every collection point and consequently is very slow to run,
and ends up being the main bottleneck of the modules.exp testsuite.

So this patch restricts this test to run once, in C++20 mode, instead of
multiple times (C++17, C++20 and C++23 mode by default).  After this
patch the modules.exp testsuite finishes in 3m instead of 3m40s with -j8
on my machine.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/pr99023_a.X: Run only in C++20 mode.
	* g++.dg/modules/pr99023_b.X: Likewise.
---
 gcc/testsuite/g++.dg/modules/pr99023_a.X | 1 +
 gcc/testsuite/g++.dg/modules/pr99023_b.X | 1 +
 2 files changed, 2 insertions(+)

diff --git a/gcc/testsuite/g++.dg/modules/pr99023_a.X b/gcc/testsuite/g++.dg/modules/pr99023_a.X
index c872d15f792..507e9569535 100644
--- a/gcc/testsuite/g++.dg/modules/pr99023_a.X
+++ b/gcc/testsuite/g++.dg/modules/pr99023_a.X
@@ -1,4 +1,5 @@
 // PR c++/99023, ICE
+// { dg-require-effective-target c++20_only }
 // { dg-additional-options {-x c++-system-header initializer_list -fmodules-ts --param ggc-min-expand=0} }
 
 // { dg-prune-output {linker input file unused} }
diff --git a/gcc/testsuite/g++.dg/modules/pr99023_b.X b/gcc/testsuite/g++.dg/modules/pr99023_b.X
index ca5f32e5bcc..59d32bee8d5 100644
--- a/gcc/testsuite/g++.dg/modules/pr99023_b.X
+++ b/gcc/testsuite/g++.dg/modules/pr99023_b.X
@@ -1,4 +1,5 @@
 // PR c++/99023, ICE
+// { dg-require-effective-target c++20_only }
 // { dg-additional-options {-x c++-system-header iostream -fmodules-ts -flang-info-include-translate=<initializer_list> --param ggc-min-expand=0} }
 
 // { dg-prune-output {linker input file unused} }
-- 
2.45.0.rc0


> 
> > -- >8 --
> > 
> > The below testcase uses --param=ggc-min-expand=0 which forces a full GC
> > during every collection point and in turn takes over two minutes to run
> > and ends up being the main bottleneck of the modules.exp testsuite.
> > 
> > This patch speeds up this test without (hopefully) significantly affecting
> > its coverage by using =1 instead of =0 which forces a full GC each time the
> > heap grows by 1%, which means exponentially fewer GCs.  After this patch
> > the modules.exp testsuite finishes in 2m55s instead of 3m40s with -j8 on
> > my machine.
> > 
> > gcc/testsuite/ChangeLog:
> > 
> > 	* g++.dg/modules/pr99023_a.X: Use ggc-min-expand=1 instead of =0.
> > 	* g++.dg/modules/pr99023_b.X: Likewise.
> > ---
> >   gcc/testsuite/g++.dg/modules/pr99023_a.X | 2 +-
> >   gcc/testsuite/g++.dg/modules/pr99023_b.X | 2 +-
> >   2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/gcc/testsuite/g++.dg/modules/pr99023_a.X
> > b/gcc/testsuite/g++.dg/modules/pr99023_a.X
> > index c872d15f792..96bb4a2ab5a 100644
> > --- a/gcc/testsuite/g++.dg/modules/pr99023_a.X
> > +++ b/gcc/testsuite/g++.dg/modules/pr99023_a.X
> > @@ -1,5 +1,5 @@
> >   // PR c++/99023, ICE
> > -// { dg-additional-options {-x c++-system-header initializer_list
> > -fmodules-ts --param ggc-min-expand=0} }
> > +// { dg-additional-options {-x c++-system-header initializer_list
> > -fmodules-ts --param ggc-min-expand=1} }
> >     // { dg-prune-output {linker input file unused} }
> >   diff --git a/gcc/testsuite/g++.dg/modules/pr99023_b.X
> > b/gcc/testsuite/g++.dg/modules/pr99023_b.X
> > index ca5f32e5bcc..955378ad88f 100644
> > --- a/gcc/testsuite/g++.dg/modules/pr99023_b.X
> > +++ b/gcc/testsuite/g++.dg/modules/pr99023_b.X
> > @@ -1,5 +1,5 @@
> >   // PR c++/99023, ICE
> > -// { dg-additional-options {-x c++-system-header iostream -fmodules-ts
> > -flang-info-include-translate=<initializer_list> --param ggc-min-expand=0} }
> > +// { dg-additional-options {-x c++-system-header iostream -fmodules-ts
> > -flang-info-include-translate=<initializer_list> --param ggc-min-expand=1} }
> >     // { dg-prune-output {linker input file unused} }
> >   
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] c++/modules testsuite: avoid expensive ggc-min-expand=0
  2024-04-24 12:49   ` Patrick Palka
@ 2024-04-24 13:59     ` Jason Merrill
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Merrill @ 2024-04-24 13:59 UTC (permalink / raw)
  To: Patrick Palka; +Cc: gcc-patches

On 4/24/24 05:49, Patrick Palka wrote:
> On Tue, 23 Apr 2024, Jason Merrill wrote:
> 
>> On 4/23/24 11:28, Patrick Palka wrote:
>>> Tested on x86_64-pc-linux-gnu, does this look OK for trunk?
>>
>> Is the test being run for multiple standard levels?  I'd rather restrict it to
>> one and keep fully testing GC-safety.
> 
> Ah yeah, looks like it runs three times by default, in C++17, C++20 and
> C++23 mode.  Like so?  The speedup is almost as good as using
> ggc-min-expand=1.

OK.

> Interestingly, restricting to one standard level _and_ using
> ggc-min-expand=1 does not give further speedup.
> 
> -- >8 --
> 
> Subject: [PATCH] c++/modules testsuite: restrict expensive pr99023 test
> 
> The pr99023 testcase uses --param=ggc-min-expand=0 which forces a GC
> during every collection point and consequently is very slow to run,
> and ends up being the main bottleneck of the modules.exp testsuite.
> 
> So this patch restricts this test to run once, in C++20 mode, instead of
> multiple times (C++17, C++20 and C++23 mode by default).  After this
> patch the modules.exp testsuite finishes in 3m instead of 3m40s with -j8
> on my machine.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* g++.dg/modules/pr99023_a.X: Run only in C++20 mode.
> 	* g++.dg/modules/pr99023_b.X: Likewise.
> ---
>   gcc/testsuite/g++.dg/modules/pr99023_a.X | 1 +
>   gcc/testsuite/g++.dg/modules/pr99023_b.X | 1 +
>   2 files changed, 2 insertions(+)
> 
> diff --git a/gcc/testsuite/g++.dg/modules/pr99023_a.X b/gcc/testsuite/g++.dg/modules/pr99023_a.X
> index c872d15f792..507e9569535 100644
> --- a/gcc/testsuite/g++.dg/modules/pr99023_a.X
> +++ b/gcc/testsuite/g++.dg/modules/pr99023_a.X
> @@ -1,4 +1,5 @@
>   // PR c++/99023, ICE
> +// { dg-require-effective-target c++20_only }
>   // { dg-additional-options {-x c++-system-header initializer_list -fmodules-ts --param ggc-min-expand=0} }
>   
>   // { dg-prune-output {linker input file unused} }
> diff --git a/gcc/testsuite/g++.dg/modules/pr99023_b.X b/gcc/testsuite/g++.dg/modules/pr99023_b.X
> index ca5f32e5bcc..59d32bee8d5 100644
> --- a/gcc/testsuite/g++.dg/modules/pr99023_b.X
> +++ b/gcc/testsuite/g++.dg/modules/pr99023_b.X
> @@ -1,4 +1,5 @@
>   // PR c++/99023, ICE
> +// { dg-require-effective-target c++20_only }
>   // { dg-additional-options {-x c++-system-header iostream -fmodules-ts -flang-info-include-translate=<initializer_list> --param ggc-min-expand=0} }
>   
>   // { dg-prune-output {linker input file unused} }


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-24 13:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 18:28 [PATCH] c++/modules testsuite: avoid expensive ggc-min-expand=0 Patrick Palka
2024-04-23 20:02 ` Jason Merrill
2024-04-24 12:49   ` Patrick Palka
2024-04-24 13:59     ` Jason Merrill

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).