This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 6/9] Add --param tunables for the initial size of the type merging hash tables
- From: Geert Bosch <bosch at gnat dot com>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: gcc-patches at gcc dot gnu dot org, hubicka at ucw dot cz, Andi Kleen <ak at linux dot intel dot com>
- Date: Mon, 22 Apr 2013 12:24:12 -0400
- Subject: Re: [PATCH 6/9] Add --param tunables for the initial size of the type merging hash tables
- References: <1366407117-18462-1-git-send-email-andi at firstfloor dot org> <1366407117-18462-7-git-send-email-andi at firstfloor dot org>
On Apr 19, 2013, at 17:31, Andi Kleen <email@example.com> wrote:
> Later on I think it's better to either always use large hash tables
> (virtual memory is cheap) or to dynamically size them based on a
> estimate of the available types.
That logic doesn't really work for hash tables. Assuming the hash keys
as close to random (as they should be), there is no locality of reference,
so most/all of the hash table will be part of the working set: hash tables
don't just use virtual memory, they use real memory.
A very sparsely populated hash table may end up wasting most of each VM page
to just store a few hashed values. Bad for locality, and bad for performance.