comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: GNAT (GCC) Profile Guided Compilation
Date: Mon, 02 Jul 2012 19:15:28 +0200
Date: 2012-07-02T19:15:29+02:00	[thread overview]
Message-ID: <4ff1d731$0$6582$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <a4f2a43e-5593-48f6-9e0f-7d0057874f94@googlegroups.com>

On 02.07.12 00:57, Keean Schupke wrote:
> The real benefit (and performance gains) from profile guided compilation come from correcting branch prediction. As such the gains will be most apparent when there is an 'if' statement in the inner loop of the code. Try something where you are taking the sign of an int in the formula and have three cases <0 =0 >0.


Thanks for your lucid words, I was mostly guessing at what profile
guided compilation might actually do. Indeed, now that I have started
playing with conditionals, the translations show very different effects
already, for variations of the procedure below,

   procedure Compute_1D (A : in out Matrix_1D) is
   begin
      for K in A'First + Len + 1 .. A'Last - Len - 1 loop
         case K mod Len is
         when 0 | Len - 1 => null;
         when others =>
            A (K) := (A(K + 1)
                        + A(K - Len)
                        + A(K - 1)
                        + A(K + Len)) mod Num'Last;
         end case;
         if A (K) mod 6 = 0 then
            A (K) := (A (K) - 1) mod Num'Last;
         else
            A (K) := K mod Num'Last;
         end if;
      end loop;
   end Compute_1D;

Ada and C++ are mostly on a par without help from a profile
(the 2D approach is still better in the Ada case; perhaps mod 6
isn't true for that many K). C++ gains 8%, Ada only 4%, though.


Cheers,
Georg



  reply	other threads:[~2012-07-02 17:15 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-29  9:17 GNAT (GCC) Profile Guided Compilation Keean Schupke
2012-06-29  9:34 ` Dmitry A. Kazakov
2012-06-29 10:01   ` Keean Schupke
2012-06-29 10:24     ` Keean Schupke
2012-06-29 12:26       ` stefan-lucks
2012-06-29 12:51         ` Keean Schupke
2012-06-29 12:05     ` Dmitry A. Kazakov
2012-06-29 10:48 ` Simon Wright
2012-06-29 11:14   ` Keean Schupke
2012-06-29 12:39 ` gautier_niouzes
2012-06-29 12:52   ` Keean Schupke
2012-06-29 14:14     ` gautier_niouzes
2012-06-29 15:05       ` gautier_niouzes
2012-06-29 17:03         ` Keean Schupke
2012-07-01  9:29           ` Georg Bauhaus
2012-07-01 17:45           ` Georg Bauhaus
2012-07-01 22:57             ` Keean Schupke
2012-07-02 17:15               ` Georg Bauhaus [this message]
2012-07-02 17:26                 ` Keean Schupke
2012-07-02 23:48                   ` Keean Schupke
2012-07-04 10:38                     ` Georg Bauhaus
2012-07-04 10:57                       ` Keean Schupke
2012-07-04 12:36                         ` Mark Lorenzen
2012-07-04 12:38                         ` Georg Bauhaus
2012-07-14 20:17                           ` Keean Schupke
2012-07-14 20:33                             ` Keean Schupke
2012-07-14 20:43                             ` Niklas Holsti
2012-07-14 22:32                               ` Keean Schupke
2012-07-14 23:40                                 ` Keean Schupke
2012-07-15  7:15                                   ` Niklas Holsti
2012-07-15  8:27                                     ` Keean Schupke
2012-07-18 10:01                                       ` Georg Bauhaus
2012-07-18 17:36                                         ` Keean Schupke
2012-07-19  5:42                                           ` Georg Bauhaus
2012-07-19 10:18                                             ` Keean Schupke
2012-07-15 11:02                                     ` Niklas Holsti
2012-07-15 12:48                                       ` Keean Schupke
replies disabled

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