Re: [PATCH][C++] Save memory and reallocations in name-lookup

2012-08-20 Thread Richard Guenther
On Sat, 18 Aug 2012, Dimitrios Apostolou wrote: > Hi, > > On Fri, 17 Aug 2012, Jakub Jelinek wrote: > > On Fri, Aug 17, 2012 at 06:41:37AM -0500, Gabriel Dos Reis wrote: > > > I am however concerned with: > > > > > > > static void > > > > store_bindings (tree names, VEC(cxx_saved_binding,gc)

Re: [PATCH][C++] Save memory and reallocations in name-lookup

2012-08-17 Thread Dimitrios Apostolou
Hi, On Fri, 17 Aug 2012, Jakub Jelinek wrote: On Fri, Aug 17, 2012 at 06:41:37AM -0500, Gabriel Dos Reis wrote: I am however concerned with: static void store_bindings (tree names, VEC(cxx_saved_binding,gc) **old_bindings) { ! static VEC(tree,heap) *bindings_need_stored = NULL; I wo

Re: [PATCH][C++] Save memory and reallocations in name-lookup

2012-08-17 Thread Gabriel Dos Reis
On Fri, Aug 17, 2012 at 6:55 AM, Jakub Jelinek wrote: > On Fri, Aug 17, 2012 at 06:41:37AM -0500, Gabriel Dos Reis wrote: >> I am however concerned with: >> >> > static void >> > store_bindings (tree names, VEC(cxx_saved_binding,gc) **old_bindings) >> > { >> > ! static VEC(tree,heap) *bind

Re: [PATCH][C++] Save memory and reallocations in name-lookup

2012-08-17 Thread Jakub Jelinek
On Fri, Aug 17, 2012 at 06:41:37AM -0500, Gabriel Dos Reis wrote: > I am however concerned with: > > > static void > > store_bindings (tree names, VEC(cxx_saved_binding,gc) **old_bindings) > > { > > ! static VEC(tree,heap) *bindings_need_stored = NULL; > > I would be more comfortable to s

Re: [PATCH][C++] Save memory and reallocations in name-lookup

2012-08-17 Thread Richard Guenther
On Fri, 17 Aug 2012, Gabriel Dos Reis wrote: > On Fri, Aug 17, 2012 at 6:17 AM, Richard Guenther wrote: > > > > This reduces the number of re-allocations and the amount of memory > > wasted by store_binding. Previously, on a cut-down testcase from > > PR54146 we can see (--enable-gather-detailed

Re: [PATCH][C++] Save memory and reallocations in name-lookup

2012-08-17 Thread Gabriel Dos Reis
On Fri, Aug 17, 2012 at 6:17 AM, Richard Guenther wrote: > which means only 19516 reallocations and 350kb wasted memory. The > compile-time effects are neutral (name-lookup is 1.0+-0.05s on > the reduced testcase) - a slightly different version which omitted > the temporary vector but walked thi

Re: [PATCH][C++] Save memory and reallocations in name-lookup

2012-08-17 Thread Gabriel Dos Reis
On Fri, Aug 17, 2012 at 6:17 AM, Richard Guenther wrote: > > This reduces the number of re-allocations and the amount of memory > wasted by store_binding. Previously, on a cut-down testcase from > PR54146 we can see (--enable-gather-detailed-mem-stats -fmem-report > output): > > cp/name-lookup.c:

[PATCH][C++] Save memory and reallocations in name-lookup

2012-08-17 Thread Richard Guenther
This reduces the number of re-allocations and the amount of memory wasted by store_binding. Previously, on a cut-down testcase from PR54146 we can see (--enable-gather-detailed-mem-stats -fmem-report output): cp/name-lookup.c:5874 (store_binding) 12033504: 1.6% 8564032: 2.4%