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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,64b29dfa2220a59f X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!exabot.com!freenix!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Message-ID: <46A5B0FE.3060008@obry.net> Date: Tue, 24 Jul 2007 09:57:50 +0200 From: Pascal Obry Organization: Home - http://www.obry.net User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 Newsgroups: comp.lang.ada To: Randy Brukardt Subject: Re: Reserve_Capacity for Unbounded_String? References: <1185134043.892012.217560@n2g2000hse.googlegroups.com> <1185203238.701948.307410@m37g2000prh.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 24 Jul 2007 09:57:59 CEST NNTP-Posting-Host: 82.124.117.158 X-Trace: 1185263879 news.orange.fr 27406 82.124.117.158:2976 X-Complaints-To: abuse@orange.fr Xref: g2news1.google.com comp.lang.ada:16580 Date: 2007-07-24T09:57:59+02:00 List-Id: Randy Brukardt a �crit : > In any case, implementing Reserve_Capacity to do anything (as opposed to > being a no-op) in Janus/Ada would require junking the entire existing > implementation and starting over. It surely would add overhead (because > you'd continually need to check the allocated length against the "nominal" > length). As such, this is something I would fight strongly. Well this is already done in GNAT for speed performances. If you are adding lot of chunk of string into an Unbounded_String it is far too costly to reallocate the Unbounded_String buffer each time. This was a huge speed penalty for the templates_parser for example. The current GNAT implementation is just what users would expect it to be. Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595