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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c32f6f0b23106020 X-Google-Attributes: gid103376,public From: Florian Weimer Subject: Re: Large strings in ADA Date: 2000/04/17 Message-ID: <877ldxxo5b.fsf@deneb.cygnus.argh.org>#1/1 X-Deja-AN: 612115431 References: <38FA3003.A38D7B51@xpress.se> Mail-Copies-To: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@cygnus.argh.org X-Trace: deneb.cygnus.argh.org 955951232 2735 192.168.1.2 (17 Apr 2000 06:00:32 GMT) Organization: Penguin on board User-Agent: Gnus/5.0804 (Gnus v5.8.4) Emacs/20.6 Mime-Version: 1.0 Reply-To: Florian Weimer NNTP-Posting-Date: 17 Apr 2000 06:00:32 GMT Newsgroups: comp.lang.ada Date: 2000-04-17T06:00:32+00:00 List-Id: Johan Groth writes: > for I in 1 .. 1600 loop > Append_To_Msg(Str.Info, Basic_Natural(Str.Len), Msg, Last); > if (I mod 100) = 0 then > Put(" " & Integer'Image(I)); > end if; > end loop; For example, the GNAT implementation of Unbounded_String, results in four allocator calls and copy operations per iteration, and this is expensive. Perhaps you should switch to a different string-like type which preallocates storage.