delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2007/12/05/22:31:46

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
Date: Wed, 05 Dec 2007 19:29:48 -0700
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Subject: Re: gcc-4.3. snapshots and DJGPP memory allocator efficiency
In-reply-to: <47572E5D.5030206@iki.fi>
To: djgpp-workers AT delorie DOT com
Message-id: <gfnel31vtl06md1v87ngark2la1e7jviil@4ax.com>
Organization: Systematic Software
MIME-version: 1.0
X-Mailer: Forte Agent 1.93/32.576 English (American)
References: <47571B5D DOT 5090305 AT iki DOT fi> <47572E5D DOT 5030206 AT iki DOT fi>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 06 Dec 2007 01:03:57 +0200, Andris Pavenis
<andris DOT pavenis AT iki DOT fi> wrote:

>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.
>> 
>> Currently I see that perhaps the same thing happens (I haven't verified 
>> with debugger) when compiling gcc/ada/g-catiio.adb (killed after about 
>> 60 minutes, I don't know how much it will still would require)
>> 
>> Wrote simple test (see attachment). I'm getting from this test on mostly 
>> idle machine (cannot get rid of WinXP though):
>> 
>> for s in 50000 100000 150000 200000 250000; do ./memalloctest $s; done
>>   50000    0.055    0.000    0.440
>>  100000    0.000    0.000    1.978
>>  150000    0.055    0.000    5.055
>>  200000    0.055    0.000   18.626
>>  250000    0.055    0.000   41.868
>> 
>> So one can imagine what we'll get if the number will be some millions...
>
>For comparisson run the same program under Linux (on the same computer) with noticeably larger 
>allocation counts:
>[andris AT ap Test]$ g++ -m32 -O2 memalloctest.cpp -o memalloctest
>[andris AT ap Test]$ for s in $(seq 1 10); do ./memalloctest $(($s*1000000)); done
>  1000000    0.070    0.050    0.180
>  2000000    0.170    0.160    0.360
>  3000000    0.260    0.210    0.550
>  4000000    0.330    0.320    0.790
>  5000000    0.430    0.430    1.000
>  6000000    0.520    0.580    1.250
>  7000000    0.600    0.670    1.410
>  8000000    0.640    0.820    1.630
>  9000000    0.730    0.970    1.980
>10000000    0.910    1.120    2.200
>
>So one can see that DJGPP version of free() performance is extremly bad.

Does this use standard djgpp malloc or CBF nmalloc package? 
How about trying the other package for comparison? 
-- 
Thanks. Take care, Brian Inglis 	Calgary, Alberta, Canada

- Raw text -


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