comp.lang.ada
 help / color / mirror / Atom feed
From: "Markus Schöpflin" <no.spam@spam.spam>
Subject: Re: Profiling Ada binaries
Date: Tue, 26 Jul 2016 10:37:29 +0200
Date: 2016-07-26T10:37:29+02:00	[thread overview]
Message-ID: <04e12bd0-2c9d-f90d-2497-bf58593addfd@spam.spam> (raw)
In-Reply-To: a9f6bc88-81e3-480f-9e2d-91060e1dbdb5@googlegroups.com

Am 25.07.2016 um 18:45 schrieb rieachus@comcast.net:

> Gee. I would never think to compile the math libraries with -O1.
> Seriously, the math libraries are written with ease of understanding in
> mind.  You may have thousands of calls in the implementation of one
> function, and due to the packages being generic, every one of those calls
> will do an elaboration check.  How can that be efficient?

GNAT by default uses static elaboration. There should be no elaboration checks 
when calling the generic versions. Or am I mistaken here?

 > I believe GNAT
> has non-generic versions for Short_Float, Float, and Long_Float which use
> the hardware built-ins.  But I doubt you would get that automatically with
> -O1.

Even using the non-generic versions I have not been able to get the hardware 
built-ins. The best I can achieve for a call to e.g. cos(X) is:

         call    ada__numerics__long_elementary_functions__cos

> Try compiling everything with -O3 (or whatever you use) then recompile only
> the unit you want the tracing for with -O1 and -fno-inline-functions-called-once.

-O3 is explicitly discouraged by the documentation, so we're normally using 
-O2. And to get a general feeling on where the application is burning its CPU 
cycles, -O1 seems to be OK, as the execution time normally is dominated by the 
choice of algorithms and not by differences in the optimization level.

Markus

  parent reply	other threads:[~2016-07-26  8:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 13:24 Profiling Ada binaries Markus Schöpflin
2016-07-22 14:59 ` Alejandro R. Mosteo
2016-07-22 15:05   ` Alejandro R. Mosteo
2016-07-25  7:01     ` Markus Schöpflin
2016-07-25 16:45       ` rieachus
2016-07-25 17:14         ` Simon Wright
2016-07-25 22:05           ` rieachus
2016-07-26  8:37         ` Markus Schöpflin [this message]
2016-08-01 22:40           ` rieachus
2016-08-01 23:36             ` Jeffrey R. Carter
2016-08-02  7:00               ` Markus Schöpflin
2016-08-05  3:18               ` rieachus
2016-08-05 20:27                 ` Randy Brukardt
2016-08-02  6:39             ` Markus Schöpflin
2016-07-25  6:57   ` Markus Schöpflin
replies disabled

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