comp.lang.ada
 help / color / mirror / Atom feed
From: "Warren W. Gay VE3WWG" <ve3wwg@cogeco.ca>
Subject: Re: Overhead for type conversions?
Date: Sat, 26 Jul 2003 12:01:43 -0400
Date: 2003-07-26T12:01:43-04:00	[thread overview]
Message-ID: <SGxUa.389$XK4.17275@read1.cgocable.net> (raw)
In-Reply-To: bfu83g$ibodl$1@ID-25716.news.uni-berlin.de

"Nick Roberts" <nickroberts@blueyonder.co.uk> wrote in message news:bfu83g$ibodl$1@ID-25716.news.uni-berlin.de...
> "Bobby D. Bryant" <bdbryant@mail.utexas.edu> wrote in message
> news:pan.2003.07.25.01.01.43.5699@mail.utexas.edu...
>
> > Given these declarations -
> >
> >    type f1 is new float;
> >    type f2 is new float;
> >
> >    function "*"( left : in f1; right : in f2 ) return f1 is
> >    begin
> >       return( left * f1( right ) );
> >    end "*";
> >
...
> I would also suggest that a function like this should be declared inline,
> since it is likely that the eliminated call and return code would be bigger
> (as well as much slower) than the intrinsic code for the multiplication
> anyway.

I once suggested something like this to Simon Wright regarding
some procedure/function calls within the Booch Components. He
did some profiling, and discovered that inlining that I suggested
actually worsened the performance slightly under Linux. I don't
know if he did more investigations along this line, but for
the examples that I suggested, it actually made things worse
(due to instruction caching reasons I expect).

So inlining should probably be tested before the conclusion is
made. Furthermore, inlining on one platform may hurt another
platform's performance (which is a difficult portability issue
to deal with in the source code without a preprocessor).

Perhaps a platform sensitive pragma Inline is called for? ;-)

-- 
Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg





  reply	other threads:[~2003-07-26 16:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-25  1:01 Overhead for type conversions? Bobby D. Bryant
2003-07-25  2:36 ` Robert I. Eachus
2003-07-25  7:12   ` Bobby D. Bryant
2003-07-25 15:34 ` Matthew Heaney
2003-07-25 18:28 ` Randy Brukardt
2003-07-26 15:54 ` Nick Roberts
2003-07-26 16:01   ` Warren W. Gay VE3WWG [this message]
2003-07-26 23:39     ` Bobby D. Bryant
2003-07-27 13:41       ` Loop Optimisation [was: Overhead for type conversions?] Nick Roberts
replies disabled

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