Mail Archives: djgpp-workers/2007/12/06/08:41:27
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 -