comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Calling inherited primitive operations in Ada
Date: Tue, 6 Sep 2022 19:51:44 -0500	[thread overview]
Message-ID: <tf8pv1$1nld$1@dont-email.me> (raw)
In-Reply-To: 458444ed-e384-4663-896c-bb38dae3c5cbn@googlegroups.com

"Emmanuel Briot" <briot.emmanuel@gmail.com> wrote in message 
news:458444ed-e384-4663-896c-bb38dae3c5cbn@googlegroups.com...
...
> Randy Brukardt:
>> Assuming otherwise is certainly premature optimization.
>
> I am quoting a bit out of context, though I believe it is close enough.
> Designers of containers must care about performance
> from the get-go. Otherwise, people might just as well use a list for
> everything and just traverse the list all the time. We all
> know this would be way too inefficient, of course, which is why there
> are various sorts of containers. Anyone who has actually written
> performance-sensitive code knows that memory allocations is definitely
> something to watch out for, and the library design should definitely take
> that into account.

Definitely out of context. If you have code which is truly performance 
sensitive, then it cannot also be portable Ada code. That's because of the 
wide variety of implementation techniques, especially for generics. (For 
Janus/Ada, if you have critical performance needs, you have to avoid the use 
of generics in those critical paths -- sharing overhead is non-zero.)

I agree that the design of the containers matters (which is why the we made 
the sets of operations for the various containers as close as possible, so 
switching containers is relatively easy). But the indefinite/definite thing 
is premature optimization - it makes little difference for a Janus/Ada 
generic, at least in the absence of the full-program optimizer (that we 
never built). If your code isn't intended to be portable Ada code, then 
*maybe* it makes sense to worry about such things. But the expectation was 
always that containers would be useful in cases where the performance is 
*not* critical - one probably should use a custom data structure for 
performance critical things. (But most things aren't really performance 
critical in reality.)

                                     Randy.


  parent reply	other threads:[~2022-09-07  0:51 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31  8:15 Calling inherited primitive operations in Ada Emmanuel Briot
2022-08-31 17:11 ` DrPi
2022-08-31 19:13 ` Dmitry A. Kazakov
2022-09-01  6:56   ` Emmanuel Briot
     [not found]     ` <67b32db0-c4db-466c-ac13-e597e008c762n@googlegroups.com>
2022-09-01 10:02       ` Dmitry A. Kazakov
2022-09-01 11:59       ` Jeffrey R.Carter
2022-09-01 12:37         ` Dmitry A. Kazakov
2022-09-01 13:37           ` Jeffrey R.Carter
2022-09-01 14:10             ` Emmanuel Briot
2022-09-01 15:50               ` amo...@unizar.es
2022-09-01 16:03               ` Jeffrey R.Carter
2022-09-01 16:07                 ` Emmanuel Briot
2022-09-01 16:17                   ` Jeffrey R.Carter
2022-09-01 18:54                     ` Emmanuel Briot
2022-09-01 21:33                       ` Jeffrey R.Carter
2022-09-02  6:11                         ` Emmanuel Briot
2022-09-02 10:55                           ` Jeffrey R.Carter
2022-09-02 11:20                             ` Emmanuel Briot
2022-09-02 14:28                               ` Jeffrey R.Carter
2022-09-03  0:16                               ` Randy Brukardt
2022-09-03  0:07                           ` Randy Brukardt
2022-09-03  8:59                             ` Jeffrey R.Carter
2022-09-07  0:42                               ` Randy Brukardt
2022-09-03 19:00                             ` Simon Wright
2022-09-05  6:56                               ` Emmanuel Briot
2022-09-05  7:34                                 ` Dmitry A. Kazakov
2022-09-05  9:30                                 ` Jeffrey R.Carter
2022-09-07  0:51                                 ` Randy Brukardt [this message]
2022-09-02  8:35                         ` amo...@unizar.es
2022-09-02  8:48                           ` Dmitry A. Kazakov
     [not found]                             ` <9484a755-f55d-407e-a40b-92421b0bcafbn@googlegroups.com>
2022-09-02  9:55                               ` Dmitry A. Kazakov
2022-09-02 10:41                           ` Jeffrey R.Carter
2022-09-02 11:04                             ` Dmitry A. Kazakov
2022-09-03  0:12                               ` Randy Brukardt
2022-09-03  8:23                                 ` Dmitry A. Kazakov
2022-09-03  0:01                           ` Randy Brukardt
2022-09-05  8:53                             ` amo...@unizar.es
replies disabled

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