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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e6c9800e35ccfeee X-Google-Attributes: gid103376,public From: "Tarjei T. Jensen" Subject: Re: GNAT: Performance of String functions Date: 1997/07/20 Message-ID: <33D1D2BB.2023@online.no>#1/1 X-Deja-AN: 257817262 References: <33CF3908.3DF62EEE@ericsson.com> <33D11806.6C59@online.no> Organization: Jensen programvareutvikling Reply-To: tarjei@online.no Newsgroups: comp.lang.ada Date: 1997-07-20T00:00:00+00:00 List-Id: Robert Dewar wrote: > > Tarjei said > > < descriptor is of type counted string. A counted string has a maximum > size, an actual size and the string itself. I'm not sure anymore if the > descriptor contains the maximum size of the string or if the programmer > have to keep track of this. > > This means that comparing Ada bounded strings and VAX Pascal strings > compares two different ways of doing things. Each time you change the > size of an Ada bounded string there can be serious overhead. > >> > > So, clearly Vax Pascal strings are to be compared with bounded strings, > not with unbounded strings, and presumably there is no automatic > finalization involved. > > I am not sure what your "serious" overhead message is about, makes no > sense to me, but perhaps it is just not clear. I wrote bounded string when I meant unbounded string. Silly me. As unbounded strings are allocated on the heap there is a potential serious overhead in allocating and deallocating space for these strings as they change size. The serious overhead can include system calls to allocate or free space. I expect that it also include wholesale copying of the contents of the strings. I have not checked the GNAT source for how unbounded strings are handled. Greetings, -- // Tarjei T. Jensen // tarjei@online.no || voice +47 51 62 85 58 // Support you local rescue centre: GET LOST!