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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3d9b089555215fa7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news2.volia.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Ada memory management seems slow Date: Fri, 14 Oct 2005 11:59:14 +0200 Message-ID: <434F8172.2040502@mailinator.com> References: <2621912.Es2GesFk5Z@linux1.krischik.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net Rvv2tb2ozktThR14N2UjXgyWngfK1gAk0o/ZVMb3AkSKrDEqg= User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050912) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:5638 Date: 2005-10-14T11:59:14+02:00 List-Id: 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. > >