[PATCH] Reduce GC overhead by introducing extra bins for function and basic_block

Mark Mitchell mark@codesourcery.com
Mon Jun 19 18:45:00 GMT 2006


Richard Guenther wrote:
> On Mon, 19 Jun 2006, Mark Mitchell wrote:
> 
>> Richard Guenther wrote:
>>> This addresses the fact that struct function is at the moment (on 32bit
>>> platforms) 264 bytes large and allocated from the 512 bytes bucket, which
>>> is quite a large overhead.  The same holds true for basic_block as of
>>> detailed memory reporting.
>>>
>>> Unfortunately(?) to work properly, the size_lookup array needs to be
>>> extended for this (I also made the checks for out-of range sizes <
>>> rather than <=, because the latter will access the array out-of-bounds).
>>>
>>> More objects often allocated with non-neglible overhead are
>>> struct var_ann_d, struct tree_ssa_name and phi nodes with two arguments.
>>> But this quickly leads to a huge number of entries in 
>>> extra_order_size_table, and the GC machinery does not explicitly handle
>>> duplicate sizes (i.e. it will simply get empty bins resulting from dups).
>>>
>>> Bootstrapped and tested on x86_64-unknown-linux-gnu.
>>>
>>> Ok for mainline?
>> This seems like a good idea -- but what memory savings have you observed
>> on what test cases?
> 
> There is a slight peak memory drop for tramp3d-v4 from 449MB to 447MB, but
> it mainly reduces GC allocation overhead (same testcase).

The patch is OK, thanks.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list