[PATCH] More GC tuning
Richard Guenther
rguenther@suse.de
Tue Jun 20 16:19:00 GMT 2006
This shaves off another 50% of GC overhead, 2.5% garbage and 1% peak
memory usage (ia32, 1GB ram, tramp3d-v4 at -O). In detail:
By adding var_ann_d and tree_ssa_name to the special bucket sizes, we reduce
overall GC garbage and overhead significantly for tramp3d-v4. Before the
patch:
source location Garbage Freed Leak Overhead Times
bitmap.c:139 (bitmap_element_allocate) 13272372: 1.2% 0: 0.0% 0: 0.0% 1474708: 3.6% 368677
tree-dfa.c:145 (create_var_ann) 0: 0.0% 48905940:23.2% 0: 0.0% 6520792:16.0% 815099
tree-phinodes.c:156 (allocate_phi_node) 18612352: 1.6% 0: 0.0% 0: 0.0% 2025856: 5.0% 125470
tree-ssanames.c:147 (make_ssa_name) 55504624: 4.9% 0: 0.0% 112: 0.0% 3964624: 9.8% 991156
Total 1132100042 210957962 98903676 40652228 34797258
After the patch:
bitmap.c:139 (bitmap_element_allocate) 10336200: 0.9% 0: 0.0% 0: 0.0% 0: 0.0% 369150
tree-dfa.c:145 (create_var_ann) 0: 0.0% 35864356:18.1% 0: 0.0% 0: 0.0% 815099
tree-phinodes.c:156 (allocate_phi_node) 14764096: 1.3% 0: 0.0% 0: 0.0% 70592: 0.4% 126026
tree-ssanames.c:159 (make_ssa_name) 47575392: 4.3% 0: 0.0% 96: 0.0% 0: 0.0% 991156
Total 1104637526 197754522 96300292 18962860 34798438
Note the drop in GC overhead and total garbage. Peak virtual memory usage
for -O compile of tramp3d on a 32bit arch with 1GB ram dropped from 496802kB
to 490802kB.
Bootstrapped and tested on x86_64-unknown-linux-gnu.
Ok for mainline?
Thanks,
Richard.
2006-06-19 Richard Guenther <rguenther@suse.de>
* ggc-page.c (extra_order_size_table): Add var_ann_d,
tree_ssa_name, bitmap_element and phi_node with 4 arguments
sizes.
Index: ggc-page.c
===================================================================
*** ggc-page.c (revision 114807)
--- ggc-page.c (working copy)
*************** Software Foundation, 51 Franklin Street,
*** 186,198 ****
--- 186,204 ----
static const size_t extra_order_size_table[] = {
sizeof (struct stmt_ann_d),
+ sizeof (struct var_ann_d),
sizeof (struct tree_decl_non_common),
sizeof (struct tree_field_decl),
sizeof (struct tree_parm_decl),
sizeof (struct tree_var_decl),
sizeof (struct tree_list),
+ sizeof (struct tree_ssa_name),
sizeof (struct function),
sizeof (struct basic_block_def),
+ sizeof (bitmap_element),
+ /* PHI nodes with one to three arguments are already covered by the
+ above sizes. */
+ sizeof (struct tree_phi_node) + sizeof (struct phi_arg_d) * 3,
TREE_EXP_SIZE (2),
RTL_SIZE (2), /* MEM, PLUS, etc. */
RTL_SIZE (9), /* INSN */
More information about the Gcc-patches
mailing list