comp.lang.ada
 help / color / mirror / Atom feed
From: Dale Stanbrough <dale@cs.rmit.edu.au>
Subject: Re: Large strings in ADA
Date: 2000/04/17
Date: 2000-04-17T00:00:00+00:00	[thread overview]
Message-ID: <dale-8445E2.08102617042000@news.rmit.edu.au> (raw)
In-Reply-To: 38FA3003.A38D7B51@xpress.se

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




  parent reply	other threads:[~2000-04-17  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-16  0:00 Large strings in ADA Johan Groth
2000-04-16  0:00 ` David Starner
2000-04-17  0:00 ` Florian Weimer
2000-04-17  0:00 ` Robert Dewar
2000-04-17  0:00 ` Dale Stanbrough [this message]
2000-04-17  0:00   ` tmoran
2000-04-17  0:00     ` Johan Groth
2000-04-17  0:00       ` tmoran
2000-04-18  0:00         ` tmoran
2000-04-22  0:00           ` Johan Groth
2000-04-17  0:00       ` Florian Weimer
2000-04-17  0:00       ` Robert Dewar
2000-04-17  0:00         ` David Starner
2000-04-17  0:00 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox