delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2007/12/06/08:41:27

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
Message-ID: <4757FBB9.6080103@iki.fi>
Date: Thu, 06 Dec 2007 15:40:09 +0200
From: Andris Pavenis <andris DOT pavenis AT iki DOT fi>
User-Agent: Thunderbird 2.0.0.9 (Windows/20071031)
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: gcc-4.3. snapshots and DJGPP memory allocator efficiency
References: <120620070243 DOT 12426 DOT 475761D4000619850000308A22230682229B0A02D29B9B0EBF9D0A02010C040E000D0C AT att DOT net> <4757AF98 DOT 3020207 AT iki DOT fi>
In-Reply-To: <4757AF98.3020207@iki.fi>
Reply-To: djgpp-workers AT delorie DOT com

Andris Pavenis kirjoitti:
> cbfalconer AT maineline DOT net kirjoitti:
>> Andris Pavenis wrote:
>>  
>>> There seem to be serious performance problems in GCC-4.3 for DJGPP
>>> due to slowness of free() call especially for Ada compiler.
>>>
>>> Tried to bootstrap gcc-4.3-20071130 for DJGPP (after reverting some
>>> earlier changes in libiberty/configure.ac present in snapshot).
>>> Initially thought that compiler  (gnat1.exe) has went into some
>>> infinite loop when compiling gcc/ada/ali.adb for stage2.
>>>
>>> Found that extremly long time is being spent in libibrty/hashtab.c
>>> in procedure htab_delete() which in that case uses free() to
>>> release several millions allocated memory block. htab_delete()
>>> took perhaps about 30 minutes on Intel Core 2 Quad 2.4GHz processor
>>> (I did not measure accuratelly). There is of course not much use of
>>> 4 processor cores as DJGPP cannot use them all.
>>>     
>>
>> This sounds like the O(n) free is biting.  This is solved (O(1)) in
>> nmalloc for DJGPP, available on my page at:
>>
>>    <http://cbfalconer.home.att.net/download/nmalloc.zip>
>>
>> The version in that file has a terminal section, useless, for
>> allocating large aligned blocks.  The debuggery possibilities, and
>> linkage, are all done and in the manual.
>>   
> Thanks. I tried it with my test example. Speed seems to be OK. There 
> seems however to be unstability under WinXP (when I run example from 
> bash, it randomly crashes and jumps out of bash without any error 
> message). That is worst style of crashing for DJGPP as also GDB will 
> not help much.
>
Crashes seems to be related with mamory aloocation. I commented out the 
loop which frees memory from my test example as I don't want to wait for 
months for DJGPP own free() to perform work.

After that (on computer which haves 4 Gb of memory):

for s in $(seq 1 10); do ./memalloctest.exe $(($s*1000000));  done

works reliably (as far as I have tested)  when linked  with DJGPP own 
malloc, but randomly fails when linked with nmalloc (falls out of bash).

Andris

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019