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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,edfa88b682578b7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-26 09:01:59 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!newsfeed.news2me.com!feed.cgocable.net!read1.cgocable.net.POSTED!53ab2750!not-for-mail From: "Warren W. Gay VE3WWG" Newsgroups: comp.lang.ada References: Subject: Re: Overhead for type conversions? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: Date: Sat, 26 Jul 2003 12:01:43 -0400 NNTP-Posting-Host: 24.150.168.167 X-Complaints-To: abuse@cogeco.ca X-Trace: read1.cgocable.net 1059235634 24.150.168.167 (Sat, 26 Jul 2003 12:07:14 EDT) NNTP-Posting-Date: Sat, 26 Jul 2003 12:07:14 EDT Organization: Cogeco Cable Xref: archiver1.google.com comp.lang.ada:40844 Date: 2003-07-26T12:01:43-04:00 List-Id: "Nick Roberts" wrote in message news:bfu83g$ibodl$1@ID-25716.news.uni-berlin.de... > "Bobby D. Bryant" 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