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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.36.105.1 with SMTP id e1mr5891875itc.6.1511431451449; Thu, 23 Nov 2017 02:04:11 -0800 (PST) X-Received: by 10.157.85.67 with SMTP id h3mr1020329oti.10.1511431451237; Thu, 23 Nov 2017 02:04:11 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.kjsl.com!usenet.stanford.edu!i6no4311716itb.0!news-out.google.com!193ni7956iti.0!nntp.google.com!d140no4313412itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 23 Nov 2017 02:04:10 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=89.20.165.50; posting-account=6yLzewoAAABoisbSsCJH1SPMc9UrfXBH NNTP-Posting-Host: 89.20.165.50 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0cc30dc8-4528-4e5c-91dd-24dfbe3cbcb2@googlegroups.com> Subject: Re: When to use Bounded_String? From: briot.emmanuel@gmail.com Injection-Date: Thu, 23 Nov 2017 10:04:11 +0000 Content-Type: text/plain; charset="UTF-8" Xref: feeder.eternal-september.org comp.lang.ada:49105 Date: 2017-11-23T02:04:10-08:00 List-Id: On Sunday, November 19, 2017 at 3:19:39 AM UTC+1, Victor Porton wrote: > Is it worth to use Bounded_String for short strings (which are expected to > be say 12 chars max, as a program version string)? or is Unbounded_String > fast enough and this a preliminary optimization? You could use GNATCOLL.Strings, which provide the short-string-optimization: when a string is shorter than 19 or 23 characters (32 bit and 64 bit systems) then no allocation takes place. They also provide a much larger number of operations than standard strings or unbounded_strings, are task safe, and handle unicode.