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 X-Received: by 2002:a24:3344:: with SMTP id k65-v6mr339180itk.10.1533331962292; Fri, 03 Aug 2018 14:32:42 -0700 (PDT) X-Received: by 2002:aca:c744:: with SMTP id x65-v6mr244586oif.2.1533331962164; Fri, 03 Aug 2018 14:32:42 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!d7-v6no2244528itj.0!news-out.google.com!l67-v6ni1924itl.0!nntp.google.com!d7-v6no2244525itj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 3 Aug 2018 14:32:41 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.195.62; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.195.62 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Visibility of Indexing aspects From: "Dan'l Miller" Injection-Date: Fri, 03 Aug 2018 21:32:42 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:54031 Date: 2018-08-03T14:32:41-07:00 List-Id: On Friday, August 3, 2018 at 3:56:59 PM UTC-5, Randy Brukardt wrote: > "Dan'l Miller" wrote in message=20 > news:dc0f1491-0e8c-43c5-a78f-e32d59df5f03@googlegroups.com... > On Thursday, August 2, 2018 at 3:31:18 PM UTC-5, Randy Brukardt wrote: > ... > >> My point is that a programmer that truly cares about performance (and > >> hopefully that will only be concerning in a few critical situations)= =20 > >> would > >> avoid using Reference at all if there isn't a need to update-in-place= =20 > >> part > >> of the element. That is, one would still use the underlying operations= ,=20 > >> but > >> individually rather than all automatically as part of a set. >=20 > >In the above-mentioned case of prohibiting 4 of the 5, the programmer > >seeks not performance improvement. >=20 > Better programmers don't worry about performance all of the time, but=20 > *everyone* has to worry about it some of the time. >=20 > >The programmer seeks proscribing the retention of certain* data and > >structure by the outside-of-this-package world-topics which the > >outside-of-this-package world has no business retaining or using directl= y > >or abusing, ... >=20 > This is an utterly false statement; there is plenty of reasons to use the= =20 > various parts directly; specifically for improved performance. Almost=20 > everything used in the indexing operations previously existed in the Ada= =20 > 2005 version of the container, after all. >=20 > So, since you're starting with a pair of fallicies, the rest of what you= =20 > have to say is irrelevant. ("if False then anything" is a true [and usele= ss]=20 > statement.) >=20 > Randy. Ummmmmmmmm, what is so incredibly =E2=80=9Cexpensive=E2=80=9D about Element= =3D> Self.Data(Index)'Access in OP? You seem to be making some sort of gr= oss inefficiency point, but the core piece of this conversation is OP's sem= inal-referent library =E2=80=A2forcing=E2=80=A2 the usage of only Element = =3D> Self.Data(Index)'Access, which is in effect =E2=80=98give me the von N= eumann address of an element in the array (as an alias)=E2=80=99. I am a l= ittle confused how obtaining the von Neumann address of an element in an ar= ray causes gross inefficiency; it seems like such a straight-forward lightw= eight operation: an integer calculated by mere garden-variety pointer arit= hmetic of base-address plus offset. I am a little confused how even the =E2=80=9C(as an alias)=E2=80=9D part ca= uses gross inefficiency in execution time expended. It might complicate dr= astically the =E2=80=A2release=E2=80=A2 of the array by not easily knowing = when all of the elements have been de-aliased, but when to late-release the= array is not a gross inefficiency of execution time expended; it is mere d= elay in time pessimistically until certainty has been reached that all the = aliases' lifetimes have ended. But even that meticulous lifetime tracking = seems trivial: reference count the number of aliases-to-elements anywhere = in the array; don't dealloc the entire array until the alias-lifetime refer= ence count returns to zero.