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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a65bb7bde679ed1d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.35.68 with SMTP id f4mr4062822pbj.5.1322658482443; Wed, 30 Nov 2011 05:08:02 -0800 (PST) Path: lh20ni44350pbb.0!nntp.google.com!news1.google.com!npeer02.iad.highwinds-media.com!feed-me.highwinds-media.com!cyclone02.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!feed.xsnews.nl!border-3.ams.xsnews.nl!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Natasha Kerensikova Newsgroups: comp.lang.ada Subject: Re: Ann: Natools.Chunked_Strings, beta 1 Date: Wed, 30 Nov 2011 13:08:01 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <4ed4fc37$0$2537$ba4acef3@reader.news.orange.fr> Mime-Version: 1.0 Injection-Date: Wed, 30 Nov 2011 13:08:01 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="Mda950WjNwNLAFOE7yJXQw"; logging-data="7266"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186V84cAVe9iqfr6aoVTilY" User-Agent: slrn/0.9.9p1 (FreeBSD) Cancel-Lock: sha1:+K7rNmmMxhONQuyxHDODz5Qw8C4= Xref: news1.google.com comp.lang.ada:19264 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Date: 2011-11-30T13:08:01+00:00 List-Id: Hello, On 2011-11-30, Yannick DuchĂȘne wrote: > Le Tue, 29 Nov 2011 16:37:27 +0100, Pascal Obry a Ă©crit: >> Do you have some speed/memory comparison between your Chunked_String and >> GNAT Unbounded_String? > Probably not relevant as a generality: depends on string lengths. Of course, that's why the x-axis of a benchmark graph has to be string length. > By the way, I feel the original message is based on erroneous assumptions > about implementations of Ada.Strings.Unbounded. Nothing in the RM requires > an implementations to use a single array for unbounded strings, and on the > opposite, it says `type Unbounded_String is private;`. That is not true. The only assumption was that in the specific case of building a somewhat large string through repeated append, an implementation optimized for that use case would perform better than Ada.Strings.Unbounded, which is presumably all-purpose. Hence String_Accumulator interface. Then it is a fact that GNAT implementation of Ada.Strings.Unbounded is a single contiguous array that is dynamically resized, and each resize costs a full copy of the contents (i.e. there is equivalent to C's realloc() that may resize an array without copy. Combined with the fact I use GNAT is enough (for me) to justify writing Natools.Chunked_Strings. > At least for that reason, I feel this would be even better to stick to the > exact same interface as the one of Ada.Strings.Unbounded. If that's > another implementation of Ada.Strings.Unbounded, then, this should expose > the same interface. This way, the client side could easily use one or the > other via static polymorphism. And what exactly is preventing the client side from doing exactly that? That's what I did in the client packages, through changes similar of what was described about GNAT.Spitbol. Natasha