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-Thread: a07f3367d7,8147e9052e4bc0df X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!t34g2000prd.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Child vs nested package : efficiency matter Date: Tue, 1 Jun 2010 08:38:54 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1b5a8557-d5bc-425e-b280-57ef97d27604@t34g2000prd.googlegroups.com> References: <37b699c4-da76-4b5f-9074-0aa465af4a19@v12g2000prb.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1275406735 27101 127.0.0.1 (1 Jun 2010 15:38:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 1 Jun 2010 15:38:55 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t34g2000prd.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:12174 Date: 2010-06-01T08:38:54-07:00 List-Id: On Jun 1, 8:34=A0am, Yannick Duch=EAne (Hibou57) wrote: > Le Tue, 01 Jun 2010 17:03:44 +0200, Adam Beneschan a = =A0 > =E9crit:> I can't say anything about any particular compiler. =A0One poss= ibility: > > if procedure A calls procedure B, and A and B are in the same source, > > a compiler may be able to put the code of B inline in procedure A's > > code---i.e. the code for A will include B's code, rather than > > including a "call" instruction. =A0If it does this, then in the process= , > > it may also to be able to eliminate instructions in B's code that have > > no effect on A. =A0It's a lot harder to do this if A and B are in > > different sources, which I'm assuming is happening if you are pulling > > code out of a nested package and putting it in a child package. > > Adam, I've thought about it at that moment, so I've added some pragma =A0 > Inline for the relevant subprograms in the packages specs. This did not = =A0 > change anything. > > Do you think there are some reasons to believe pragma Inline is not =A0 > properly applied with inter-package subprograms invocations ? I can't say. Different compilers will handle this differently. The language standard says that Inline pragmas don't have to be obeyed--- they are just suggestions. The only real way to tell what's going on is to disassemble the code. -- Adam