comp.lang.ada
 help / color / mirror / Atom feed
From: "amado.alves" <amado.alves@netcabo.pt>
To: <comp.lang.ada@ada-france.org>
Subject: RE: style Q: type .. is new String;
Date: Fri, 9 Jan 2004 18:17:43 -0000
Date: 2004-01-09T18:17:43+00:00	[thread overview]
Message-ID: <mailman.14.1073672281.279.comp.lang.ada@ada-france.org> (raw)

>>Me too.  And I also use Unbounded_String a lot because it has the wonderful
>>feature of memory magic (no memory associated with a US object is lost upon
>>assignment or scope exit).  (Shameless publicity: I'll expound this memory
>>magic approach to container design in Ada-Europe 2004 in the half day
>>tutorial "No Pointers, Great Programs". See you there ;-)

>What about performance?  I've always been worried about the time lost
>allocating/deallocating memory all over the place.

You still have that penalty when you do the memory management explicitly. A decently implemented unbounded container, if properly used, will not penalize you significantly more, if at all. Take a look at Charles.Vectors.Unbounded for example.

Now, if your talking hard real time, of course you need containers with absolutely predictable behaviour w.r.t. to the time their operations take. To achieve that you often write your own containers. This often has the unfortunate effect that the container and the application logics get intertwined. So a container library with real time features would be nice. Fortunately Charles-for-ARG (AI-302/2) has some time complexity features that I believe satisfy at least *soft* real time demands.

Every now and then I do experimental measures of direct vs. indirect memory managent (e.g. String vs. Unbounded_String) in real applications, and mostly I find that the time taken by memory allocation/deallocation is not significant. That is not surprising if you think that because memory allocation/deallocation is such a basic thing in the execution of programs the system mechanisms to achieve must be very optimized (and they indeed are if you look at them directly although I haven't done that in a long time).




             reply	other threads:[~2004-01-09 18:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-09 18:17 amado.alves [this message]
     [not found] <468D78E4EE5C6A4093A4C00F29DF513D04B82B19@VS2.hdi.tvcabo>
2004-01-09 17:34 ` style Q: type .. is new String; Duncan Sands
  -- strict thread matches above, loose matches on Subject: below --
2004-01-09 17:17 amado.alves
2004-01-09  0:00 tmoran
2004-01-09  2:31 ` Stephen Leake
2004-01-09  2:58 ` Robert A Duff
2004-01-09 16:10 ` Robert I. Eachus
replies disabled

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