comp.lang.ada
 help / color / mirror / Atom feed
From: kilgallen@eisner.decus.org (Larry Kilgallen)
Subject: Re: GNAT: Performance of String functions
Date: 1997/07/23
Date: 1997-07-23T00:00:00+00:00	[thread overview]
Message-ID: <1997Jul23.065317.1@eisner> (raw)
In-Reply-To: 33D4F30F.5299@online.no


Sorry for the extensive quote, but enough context may shorten this
discussion.

In article <33D4F30F.5299@online.no>, "Tarjei T. Jensen" <tarjei@online.no> writes:
>>> 
>>>Tarjei T. Jensen writes:
>>> 
>>> I suspect bounded strings will perform badly against a counted string
>>> implementation because assignment of strings involves copying the entire array
>>> whether it contains valid data or not. This makes Ada less than wonderful in
>>> applications that involve a lot of bounded string assignments.
>>
>>Larry Kilgallen wrote:
>> No, it might affect particular _implementations_ of Ada, but I have
>> read no indications that counted strings would not be a valid way of
>> implementing bounded strings.  If the Varying String datatype made
>> quite public by DEC Pascal were used in some Ada implementation to
>> implement bounded strings (and for all I know, it or something quite
>> close to it is) execution should be quite efficient for strings
>> below a certain size (ultimately one gets into page faults, cache
>> misses and other stack-vs-heap issues).
>> 
>> Larry Kilgallen
> 
> That would mean that the implementation supply a default maximum size.
> If the implementation should be more effective than the usual bounded
> string implementation the compiler whould have to know what the real
> length of a string is for assignments. Otherwise the code generated
> spends a lot of time copying junk data.

I guess I don't know  enough about the bounded string type.
I presumed the programmer could specify the maximum size (bound?).
In DEC Pascal one does that per variable, and for an Assignment
the generated code copies only as many bytes as are actually used
in the source string.  The runtime image in memory certainly
carries an indication of the current length.

Larry Kilgallen




  parent reply	other threads:[~1997-07-23  0:00 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-18  0:00 GNAT: Performance of String functions Jakob Heinemann
1997-07-18  0:00 ` Robert Dewar
1997-07-19  0:00   ` Tarjei T. Jensen
1997-07-19  0:00     ` Matthew Heaney
1997-07-20  0:00     ` Tarjei T. Jensen
1997-07-20  0:00     ` Robert Dewar
1997-07-20  0:00       ` Tarjei T. Jensen
1997-07-20  0:00         ` Robert Dewar
1997-07-21  0:00           ` Tucker Taft
1997-07-21  0:00             ` Robert Dewar
1997-07-21  0:00             ` Tarjei Jensen
1997-07-21  0:00               ` Matthew Heaney
1997-07-22  0:00               ` Robert Dewar
1997-07-22  0:00                 ` Tarjei Jensen
1997-07-22  0:00                   ` Larry Kilgallen
1997-07-22  0:00                     ` Tarjei T. Jensen
1997-07-23  0:00                       ` Robert Dewar
1997-07-23  0:00                         ` Tarjei Jensen
1997-07-23  0:00                           ` Samuel Mize
1997-07-23  0:00                             ` W. Wesley Groleau x4923
1997-07-24  0:00                             ` Robert A Duff
1997-07-24  0:00                           ` Mats Weber
1997-07-24  0:00                             ` Matthew Heaney
1997-07-24  0:00                             ` Tarjei Jensen
1997-07-24  0:00                               ` Robert Dewar
1997-07-24  0:00                               ` Matthew Heaney
1997-07-24  0:00                             ` Robert Dewar
1997-07-28  0:00                               ` Mats Weber
1997-07-28  0:00                                 ` Robert Dewar
1997-07-28  0:00                                   ` Robert Dewar
1997-07-28  0:00                                 ` Matthew Heaney
1997-07-29  0:00                                   ` Robert Dewar
1997-07-23  0:00                       ` Larry Kilgallen [this message]
1997-07-22  0:00                   ` Robert Dewar
1997-07-22  0:00   ` Jakob Heinemann
1997-07-23  0:00     ` Robert Dewar
replies disabled

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