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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada Annoyances Date: Wed, 21 Jun 2017 18:12:47 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <1ac5a44b-4423-443a-a7bb-2864d9abe78f@googlegroups.com> <1498048151.20885.28.camel@obry.net> <96174ea5-852d-44e9-8535-7c1eb24d5326@googlegroups.com> NNTP-Posting-Host: MajGvm9MbNtGBKE7r8NgYA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:47047 Date: 2017-06-21T18:12:47+02:00 List-Id: On 2017-06-21 16:52, pythoner6@gmail.com wrote: > I definitely agree that performance is best measured, not guessed > about. However, the way I see it, this restriction is (at least for my > use case where I know I don't need tagged types) at best making the > compiler work much harder to see that it can devirtualize the function > calls and at worst making my code run slower with no benefit - other > than providing a slightly nicer syntax. In Ada there is no penalty of calling a "method" vs. a "free" function. None, whatsoever. This per language type system design and different from C++. I don't consider here the overhead of using any helper types/objects and/or class-wide objects. That has nothing to do with the type under consideration being tagged or not. The penalty of a tagged type is only this: 1. Space to keep the type tag 2. By-reference passing only, even if the object is small. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de