some profiling numbers

Andrew Pinski pinskia@physics.uc.edu
Thu Jun 26 05:47:00 GMT 2003


GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

top 20 functions (there were 14046 samples) done on PR8361 with the 
mainline (20030625), yes with disable-checking:
mispredicts	function					library
	10237	init_reg_sets_1			cc1plus	
	492		walk_tree					cc1plus	
	175		comptypes					cc1plus	
	162		for_each_template_parm_r	cc1plus	
	161		cp_walk_subtrees			cc1plus	
	159		region_for_ptr_no_lock		libSystem.B.dylib
	122		bzero					libSystem.B.dylib
	110		szone_calloc				libSystem.B.dylib
	109		tsubst					cc1plus	
	107		higher_prime_number		cc1plus	
	102		malloc_zone_calloc			libSystem.B.dylib
	97		unify					cc1plus	
	77		lookup_template_class		cc1plus	
	72		ggc_alloc					cc1plus	
	64		szone_free				libSystem.B.dylib
	63		htab_find_slot_with_hash	cc1plus	
	58		no_linkage_helper			cc1plus	
	56		free_list_add_ptr			libSystem.B.dylib
	54		standard_conversion		cc1plus	
	53		free						libSystem.B.dylib

Time profile (10 seconds):
total	function					library
	1128	gt_ggc_mx_lang_tree_node	cc1plus	
	521	ggc_set_mark				cc1plus	
	511	walk_tree					cc1plus	
	446	htab_find_slot_with_hash	cc1plus	
	262	for_each_template_parm_r	cc1plus	
	257	szone_calloc				libSystem.B.dylib	
	255	ggc_alloc					cc1plus	
	237	comptypes					cc1plus	
	188	htab_find_slot			cc1plus	
	134	tree_node_structure		cc1plus	
	126	cp_tree_node_structure		cc1plus	
	125	cp_walk_subtrees			cc1plus	
	106	comp_template_args			cc1plus	
	101	cp_lexer_peek_token		cc1plus	
	98	bzero					libSystem.B.dylib	
	80	lookup_fnfields_1			cc1plus	
	80	cp_type_quals				cc1plus	
	75	free_list_add_ptr			libSystem.B.dylib	
	74	higher_prime_number		cc1plus	
	74	tsubst					cc1plus	
	71	szone_free				libSystem.B.dylib	

For an example:
sample
	line	source

	3744	int		
	3745	comp_template_args (tree oldargs, tree newargs)
62	3746	{		
	3747	  int i;		
	3748			
28	3749	  if (TREE_VEC_LENGTH (oldargs) != TREE_VEC_LENGTH (newargs))
	3750	    return 0;		
	3751			
5	3752	  for (i = 0; i < TREE_VEC_LENGTH (oldargs); ++i)
	3753	    {		
	3754	      tree nt = TREE_VEC_ELT (newargs, i);
	3755	      tree ot = TREE_VEC_ELT (oldargs, i);
	3756			
3	3757	      if (! template_args_equal (ot, nt))		
	3758		return 0;	
	3759	    }		
	3760	  return 1;		
8	3761	}

	0x30abc	  slwi     r2,r31,2		pt.c:3754
2	0x30ac0	  addi     r31,r31,1		pt.c:3752
	0x30ac4	  add      r9,r2,r30		pt.c:3755
	0x30ac8	  add      r2,r2,r29		pt.c:3754
	0x30acc	  lwz      r3,16(r9)		pt.c:3757
1	0x30ad0	  lwz      r4,16(r2)		pt.c:3757
	0x30ad4	  bl       -336 			pt.c:3757 ; call to it self
2	0x30ad8	  cmpwi    cr7,r3,0		pt.c:3757
	0x30adc	  li       r3,0			pt.c:3758
	0x30ae0	  beq-     cr7,-68 		pt.c:3757
1	0x30ae4	 lwz      r0,12(r30)		pt.c:3752	; invariant load of 
TREE_VEC_LENGTH (oldargs)
1	0x30ae8	 cmpw     cr7,r31,r0		pt.c:3752
	0x30aec	 blt      cr7,-48 <0x30abc>	pt.c:3752



Thanks,
Andrew Pinski



More information about the Gcc mailing list