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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,64b29dfa2220a59f X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!138.195.8.3.MISMATCH!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Reserve_Capacity for Unbounded_String? Date: Wed, 25 Jul 2007 13:58:19 -0500 Organization: Jacob's private Usenet server Message-ID: References: <1185134043.892012.217560@n2g2000hse.googlegroups.com> <1185203238.701948.307410@m37g2000prh.googlegroups.com> <46A5B0FE.3060008@obry.net> <46A69136.3010803@obry.net> <46A70064.8090407@obry.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1185389759 16322 69.95.181.76 (25 Jul 2007 18:55:59 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 25 Jul 2007 18:55:59 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 Xref: g2news2.google.com comp.lang.ada:1181 Date: 2007-07-25T13:58:19-05:00 List-Id: "Pascal Obry" wrote in message news:46A70064.8090407@obry.net... > Randy Brukardt a �crit : > > And now I've wasted far too much time on this worthless topic. > > If you think so! GNAT has implemented that as in a real application the > code was running more than 10 times faster. I don't think that much of a speed-up would be possible with Janus/Ada even with a specially tuned version of Ada.Strings.Unbounded. The overhead of allocation is only a portion of the total overhead, after all; call overhead, checking overhead, and copying overhead are all significant. The only way to get close would be to preallocate strings in large blocks, but that would only make sense for applications with very few unbounded strings and that do a lot of appends and '&'s. The performance would be worse on programs that use tens of thousands of Unbounded_Strings (like my spam filter and most other real apps that I've seen) because of increased paging overhead and reduced capacity. > If you think you have wasted > far too much time, no problem. I'm not a Janus/Ada customer anyway! Exactly. My response would be different to a good customer... Randy.