comp.lang.ada
 help / color / mirror / Atom feed
From: Charly <carl.weierstrass@googlemail.com>
Subject: Re: Poor performance with GNAT-GPL-2017
Date: Thu, 15 Jun 2017 08:19:19 -0700 (PDT)
Date: 2017-06-15T08:19:19-07:00	[thread overview]
Message-ID: <44aa47f0-418a-4ede-b436-1937c3dbe065@googlegroups.com> (raw)
In-Reply-To: <a279a91b-41aa-40b3-8c3c-088488d84647@googlegroups.com>

Am Dienstag, 13. Juni 2017 21:46:13 UTC+2 schrieb alkh...@gmail.com:
> On Monday, June 12, 2017 at 6:28:17 PM UTC+3, Mark Lorenzen wrote:
> > On Saturday, June 10, 2017 at 1:23:34 PM UTC+2, Charly wrote:
> > > Hi,
> > > 
> > > when I found the new GNAT-GPL-2017 this morning I was happy and installed it at once.
> > > But I was rather disappointed about the poor performance.
> > > To be more precise:
> > > 
> > > When I switch to new hard- or software I allways check the performance with my private tool:
> > > It solves Rubics Tabgle https://www.jaapsch.net/puzzles/tangle.htm with an ada programm, using one task per core.
> > > 
> > > With GNAT-GPL-2016 (gcc 4.9.4) it took about 0,4 sec to find both solutions,
> > > with GNAT-GPL-2017 (gcc 6.3.1) it takes about 0,8 sec to find both solutions,
> > > which means the program is slower by a factor of 2.
> > > 
> > > In both cases I use the following options: 
> > > -O3 -gnatA -gnatn -funroll-loops -fPIC -gnatp -g -gnatW8 -gnatVn -mtune=amdfam10 -gnat12
> > > 
> > > Any ideas??
> > 
> > Previous versions of GNAT did not have overflow check (-gnato) enabled by default, whereas newer versions have. Maybe this is what you are seeing.
> > 
> > Regards,
> > 
> > Mark L
> 
> I see Charly is compiling with '-gnatp'. Does it suppress the overflow checks as well?
> 
> Charly, it can be an interesting experiment to trace the source of this anomaly. This is strange that the compiler is emitting a code that is twice as slow. It can compile a specific language feature to be slower, but this one needs to be run frequently enough in your program. Can you guess what this feature can be? Maybe a profiler can help.
> 
> Can you try to compile your benchmark without tasking at all (remove the tasking code, rather than create 1 task)?
> 
> Can you use a different run time for the 2017 compiler?

-----
As alhk suggested, I made a new variant of my program that doesn't use any tasking when I supply option -t 0
Here are the results:

gnat-gpl-2016

$ ./bin/tangle -t 0 
using:  0 tasks
duration 2847 ms

$ ./bin/tangle -t 1
using:  1 tasks
duration 2874 ms


gnat-gpl-2017

$ ./bin/tangle -t 0 
using:  0 tasks
duration 4889 ms

$ ./bin/tangle -t 1
using:  1 tasks
duration 4936 ms

As you can see, the overhead of using one task instead of avoiding tasking at all is
a.) very small for both gnat-versions
b.) also differs by a factor 2 between gnat-version

4936 - 4889
-----------  = 0,96 %
   4889

2874 - 2847
----------- = 0,95 %
   2847

  reply	other threads:[~2017-06-15 15:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-10 11:23 Poor performance with GNAT-GPL-2017 Charly
2017-06-10 12:43 ` Jacob Sparre Andersen
2017-06-11 20:48 ` Robert Eachus
2017-06-12 19:00   ` Charly
2017-06-13  4:14     ` Robert Eachus
2017-06-13 13:57       ` Lucretia
2017-06-13 17:41         ` Robert Eachus
2017-06-12 12:21 ` Emile
2017-06-12 18:22   ` Charly
2017-06-12 15:28 ` Mark Lorenzen
2017-06-13 19:46   ` alkhimey
2017-06-15 15:19     ` Charly [this message]
2017-06-15 16:31       ` Charly
2017-06-15 18:00         ` Anh Vo
2017-06-15 19:21           ` Charly
2017-06-15 19:24             ` Anh Vo
2017-06-16 21:33         ` stephane.carrez
2017-06-21 14:29           ` gautier_niouzes
2017-06-20 22:39         ` Anatoly Chernyshev
2017-06-19 10:26     ` briot.emmanuel
2017-06-19 12:25       ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox