This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Reuse the saved_scope structures allocated by push_to_top_level
- From: Patrick Palka <patrick at parcs dot ath dot cx>
- To: Manuel LÃpez-IbÃÃez <lopezibanez at gmail dot com>
- Cc: Markus Trippelsdorf <markus at trippelsdorf dot de>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Thu, 3 Mar 2016 10:39:05 -0500
- Subject: Re: [PATCH] Reuse the saved_scope structures allocated by push_to_top_level
- Authentication-results: sourceware.org; auth=none
- References: <1457014595-5593-1-git-send-email-patrick at parcs dot ath dot cx> <20160303142245 dot GA305 at x4> <CA+C-WL9VqmHPJKdFDjEnoRY_RsSAViqWaUBH6LEkePacYQE+QA at mail dot gmail dot com> <56D856CA dot 4000103 at gmail dot com>
On Thu, Mar 3, 2016 at 10:22 AM, Manuel LÃpez-IbÃÃez
<lopezibanez@gmail.com> wrote:
> On 03/03/16 14:49, Patrick Palka wrote:
>>
>> I think the slowness of this function is mostly due to the pointer
>> chasing performed in the function store_bindings, where we iterate
>> over all the names in each non-global scope to figure out whether to
>> preserve them. It would probably improve performance if
>> cp_binding_level::names were a vector of trees instead of a linked
>> list of trees.
>
>
> It would be an overall improvement if it was neither a TREE_LIST, nor a
> TREE_VECTOR: https://gcc.gnu.org/wiki/Speedup_areas#Trees
>
> Those kinds of cleanups are always welcome even if they do not improve
> performance noticeably at first glance. The speed-up will show up once
> TREE_LIST is removed completely.
Ah yeah, I meant if cp_binding_level::names were a vec<tree, va_gc>
since it would have to be resizable.
>
> Cheers,
>
> Manuel.
>
>