From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.0.212 with SMTP id 203mr1098277ywa.14.1497539959561; Thu, 15 Jun 2017 08:19:19 -0700 (PDT) X-Received: by 10.157.26.93 with SMTP id u29mr176191otu.2.1497539959508; Thu, 15 Jun 2017 08:19:19 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!s24no488223qte.0!news-out.google.com!k7ni1844itk.0!nntp.google.com!185no807099itv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 15 Jun 2017 08:19:19 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2003:e0:abd9:66fd:96de:80ff:fea6:6d64; posting-account=5zx--goAAAD06H29EnWQGKTO-gctuXHl NNTP-Posting-Host: 2003:e0:abd9:66fd:96de:80ff:fea6:6d64 References: <65c5271c-33a1-4f36-977e-372af449d9c1@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <44aa47f0-418a-4ede-b436-1937c3dbe065@googlegroups.com> Subject: Re: Poor performance with GNAT-GPL-2017 From: Charly Injection-Date: Thu, 15 Jun 2017 15:19:19 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:46949 Date: 2017-06-15T08:19:19-07:00 List-Id: 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, > > >=20 > > > when I found the new GNAT-GPL-2017 this morning I was happy and insta= lled it at once. > > > But I was rather disappointed about the poor performance. > > > To be more precise: > > >=20 > > > When I switch to new hard- or software I allways check the performanc= e with my private tool: > > > It solves Rubics Tabgle https://www.jaapsch.net/puzzles/tangle.htm wi= th an ada programm, using one task per core. > > >=20 > > > With GNAT-GPL-2016 (gcc 4.9.4) it took about 0,4 sec to find both sol= utions, > > > with GNAT-GPL-2017 (gcc 6.3.1) it takes about 0,8 sec to find both so= lutions, > > > which means the program is slower by a factor of 2. > > >=20 > > > In both cases I use the following options:=20 > > > -O3 -gnatA -gnatn -funroll-loops -fPIC -gnatp -g -gnatW8 -gnatVn -mtu= ne=3Damdfam10 -gnat12 > > >=20 > > > Any ideas?? > >=20 > > Previous versions of GNAT did not have overflow check (-gnato) enabled = by default, whereas newer versions have. Maybe this is what you are seeing. > >=20 > > Regards, > >=20 > > Mark L >=20 > I see Charly is compiling with '-gnatp'. Does it suppress the overflow ch= ecks as well? >=20 > Charly, it can be an interesting experiment to trace the source of this a= nomaly. 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 t= his feature can be? Maybe a profiler can help. >=20 > Can you try to compile your benchmark without tasking at all (remove the = tasking code, rather than create 1 task)? >=20 > 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=20 using: 0 tasks duration 2847 ms $ ./bin/tangle -t 1 using: 1 tasks duration 2874 ms gnat-gpl-2017 $ ./bin/tangle -t 0=20 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 ----------- =3D 0,96 % 4889 2874 - 2847 ----------- =3D 0,95 % 2847