From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=BAYES_20,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: String Buffer Date: Thu, 2 Dec 2021 20:56:31 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 2 Dec 2021 19:56:31 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="a3e10bdc35821c0508dd61d5653954ec"; logging-data="32115"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18mIJwq8IVWmTa5xIfxbZ6hKVN9Qvu9v3k=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Cancel-Lock: sha1:22Ss4k82ntHUywpXtIp1BB0ITio= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:63188 List-Id: On 2021-12-02 19:17, Kevin Chadwick wrote: > > Unbounded is said to be inefficient because it re-allocates. > > In any case avoiding unbounded strings is almost certainly in the realm of premature optimisation "Efficiency" is only meaningful in the context of a project's quantitative timing requirements: an efficient implementation allows the project to meet those requirements, while an inefficient implementation does not. In the absence of such context, any claims of "inefficiency" (and especially blanket claims such as "Unbounded_String is inefficient") simply demonstrate the speaker's incompetence. For an example of context, a decade ago I worked on a soft-real-time system that made extensive use of Unbounded_String and had no problem meeting its timing requirements. Unbounded_String was clearly efficient for that project. Since most projects that would use Unbounded_String have even less restrictive timing requirements than that system, it seems likely that Unbounded_String will be efficient for them, too. -- Jeff Carter "After fifteen minutes I wanted to marry her, and after a half hour I completely gave up the idea of snatching her purse." Take the Money and Run 136