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,677065ed1513ef3b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!z7g2000vbh.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Ada Tagged Type-Operation assign? Date: Fri, 15 May 2009 07:30:33 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <003ad11c-1161-4867-9453-28eaf5663f04@r13g2000vbr.googlegroups.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1242397833 29256 127.0.0.1 (15 May 2009 14:30:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 15 May 2009 14:30:33 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z7g2000vbh.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5857 Date: 2009-05-15T07:30:33-07:00 List-Id: Patrick Gunia wrote on comp.lang.ada: > I got a question concerning Ada-Tagged-Type implementation. I=B4m > currently comparing two versions of a program written in Ada, one uses > tagged types, the other one doesn=B4t. I use VTune to evaluate the > runtime-performance of both versions and found that the call graph > display of vtunes shows one function in the tagged-type version which > gets called massively whereas there aren=B4t any calls to these > functions in my "non-tagged-type-version". This operation isn=B4t > declared by me, thus it has to be provided by the system. The > operation is named "assign". The funny thing about this is, that this > operations gets only called for tagged types which aren=B4t inherited, > all my other tagged types which are organized in class hierarchies don > =B4t show this behaviour. It might be important that these types are > aubclasses from Ada.Finalization.Controlled, maybe that=B4s a reason why > I don=B4t find the "assign"-operation. > So, now here are my questions: > Is the operation "assign" automatically provided for tagged types? > If so, is there any possibility to control this method or do I have to > accept it? > > The reason for my second question simply is the fact, that the self > time of the function is not relevant (0,00ms), though when it gets > called 3 billion times, it starts to be a relevant factor for > performance differences... I could imagine that the compiler-generated assign procedure implements the run-time checks for assignment. These run-time checks presumably exist only when the source or the target of the assignment is of a class-wide type. Is that the case? For controlled types, there should be calls to Adjust and Finalize in addition to (not instead of) assign, so my reasoning may be off-mark. It would help if you could produce a short example. -- Ludovic Brenta.