comp.lang.ada
 help / color / mirror / Atom feed
From: "Alex R. Mosteo" <devnull@mailinator.com>
Subject: Re: Ada memory management seems slow
Date: Fri, 14 Oct 2005 11:59:14 +0200
Date: 2005-10-14T11:59:14+02:00	[thread overview]
Message-ID: <434F8172.2040502@mailinator.com> (raw)
In-Reply-To: <dim9ob$o7b$1@news6.svr.pol.co.uk>

Makhno wrote:
>>GNAT uses malloc and free from the C library  for memory management - so
>>performace is the same as with C. Only with C nobody measures the
>>performance - people just expect malloc and free to be as fast as 
>>possible.
> 
> 
> I find this difficult to believe - I have experience of using free() in C, 
> and unless the lists are far bigger than I think they are, C is nowhere near 
> as slow as this.
> Is there any way I can check precisely what Ada is using? The program is 
> calling something called FREE which is defined as some sort of deallocator 
> called Ada.Unchecked_Deallocation

I'd look in what others have indicated: Is Finalization involved? How 
many objects are you finalizing? Is there some expensive computation 
taking place there?

Other than that, you could use some profiler. People has reported mixed 
success with gprof (look for past threads in this group); valgrind could 
be of use too.

>>>I was wondering what options are available for memory management, or
>>>whether I am inadvertently using a 'slow' mode.
>>
>>Well there is indeed a memory debug option - but its off by default.
> 
> 
> I'm using gnatmake with -O3.
> 
> 



  reply	other threads:[~2005-10-14  9:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-12 21:49 Ada memory management seems slow Makhno
2005-10-12 22:17 ` Robert A Duff
2005-10-13  1:39   ` Anh Vo
2005-10-13 16:39 ` Martin Krischik
2005-10-13 18:39   ` Makhno
2005-10-14  9:59     ` Alex R. Mosteo [this message]
2005-10-14 10:38       ` Martin Dowie
2005-10-14 12:06         ` Stephen Leake
2005-10-14 19:21         ` Gautier Write-only
2005-10-15 10:32           ` Georg Bauhaus
2005-10-15 11:10             ` Simon Wright
2005-10-14 19:34       ` tmoran
2005-10-14 14:49     ` Martin Krischik
2005-10-16  0:40     ` Robert A Duff
replies disabled

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