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.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: Dale Stanbrough Subject: Re: Large strings in ADA Date: 2000/04/17 Message-ID: #1/1 X-Deja-AN: 611997822 References: <38FA3003.A38D7B51@xpress.se> X-Trace: 17 Apr 2000 10:05:45 GMT, r1021c-02.ppp.cs.rmit.edu.au Organization: RMIT User-Agent: MT-NewsWatcher/3.0 (PPC) Newsgroups: comp.lang.ada Date: 2000-04-17T00:00:00+00:00 List-Id: Johan Groth wrote: > The code looks like below. I need to concatenate about 2.5MB of data. > What is the fasted way to do that in ADA? Just for comparison a similar > program in C takes about one second. There can't be a similar program in C, because C does not have controlled types. Each time you append to your unbounded_string, you could be (and most likely are) destroying the entire contents, and reallocating the unbounded_string all over again. Perhaps you should try duplicating the -exact- C semantics. Presumably you have a -very- large char buffer into which the items are copied. Alternatively, if you know of an upper bound for the length of the string, you could instantiate a Bounded_String package. Dale