comp.lang.ada
 help / color / mirror / Atom feed
* Memory chunks: are they much speed-up?
@ 2003-01-24  8:27 Victor Porton
  2003-01-24 14:32 ` Mark Johnson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Victor Porton @ 2003-01-24  8:27 UTC (permalink / raw)


Is allocating memory in chunks by several (small) objects at once a 
significant speed-up (compared to standard allocators) in typical Ada 
impl.?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Memory chunks: are they much speed-up?
  2003-01-24  8:27 Memory chunks: are they much speed-up? Victor Porton
@ 2003-01-24 14:32 ` Mark Johnson
  2003-01-24 14:37 ` Stephen Leake
  2003-01-25  2:06 ` David Marceau
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Johnson @ 2003-01-24 14:32 UTC (permalink / raw)


Victor Porton wrote:
> 
> Is allocating memory in chunks by several (small) objects at once a
> significant speed-up (compared to standard allocators) in typical Ada
> impl.?

It is hard to say because it depends upon a number of factors:
 - your allocation, deallocation pattern
 - the algorithm used in a specific allocator
 - the relative timing of allocations
and so on.

In general, a special purpose allocator will always be "faster" than a
general purpose one. It may also be "more efficient" (less unused
space). However, in general, I find it better to avoid allocation /
deallocation in my applications - especially in real time and "not have
that problem". There are several ways to do that; ask if you need some
examples.
  --Mark



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Memory chunks: are they much speed-up?
  2003-01-24  8:27 Memory chunks: are they much speed-up? Victor Porton
  2003-01-24 14:32 ` Mark Johnson
@ 2003-01-24 14:37 ` Stephen Leake
  2003-01-25  2:06 ` David Marceau
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Leake @ 2003-01-24 14:37 UTC (permalink / raw)


porton@ex-code.com (Victor Porton) writes:

> Is allocating memory in chunks by several (small) objects at once a 
> significant speed-up (compared to standard allocators) in typical Ada 
> impl.?

It might be. Depends on whether the standard allocator already does
that. So you'll have to test and see; the answer will vary with
compiler & os & target chip.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Memory chunks: are they much speed-up?
  2003-01-24  8:27 Memory chunks: are they much speed-up? Victor Porton
  2003-01-24 14:32 ` Mark Johnson
  2003-01-24 14:37 ` Stephen Leake
@ 2003-01-25  2:06 ` David Marceau
  2 siblings, 0 replies; 4+ messages in thread
From: David Marceau @ 2003-01-25  2:06 UTC (permalink / raw)


Victor Porton wrote:
> 
> Is allocating memory in chunks by several (small) objects at once a
> significant speed-up (compared to standard allocators) in typical Ada
> impl.?
If you follow ravenscar or spark I don't think you're even allowed to
allocated dynamically small or big chunks.
Everything is static.
Memory leaks are not a problem in that way.

Going back to your question though if it wasn't critical or
high-integrity, then yes using memory pools each dedicated to a certain
type of object and then reserving the memory pools in advance is
certainly much more efficient.  If ever one of the memory pools is full,
no problem just dynamically allocate another memory pool dedicated to
the object type in question.

I have seen one library product dedicated to c/C++ programmers in this
area in the past.  SmartHeap by Microquill.  You might want to check it
out.

Do memory pools impact/improve software performance?  Yes.

I hope this helps.

Cheers,
David Marceau



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-01-25  2:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-24  8:27 Memory chunks: are they much speed-up? Victor Porton
2003-01-24 14:32 ` Mark Johnson
2003-01-24 14:37 ` Stephen Leake
2003-01-25  2:06 ` David Marceau

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