Re: [PATCH] Improve kconfig symbol hashing
From: Michal Marek
Date: Mon Jan 18 2010 - 07:22:02 EST
On 13.1.2010 17:02, Andi Kleen wrote:
> This patch increases the hash table size to a larger prime
> and switches to a FNV32 hash. I played around with a couple of hash
> functions, but that one seemed to perform best with reasonable
> hash table sizes.
> Increasing the hash table size even further didn't
> seem like a good idea, because there are a couple of global
> walks which walk the complete hash table.
> I also moved the unnamed bucket to 0. It's still the longest
> of all the buckets (44 entries), but hopefully it's not
> often hit except for the global walk which doesn't care.
> The result is a much nicer distribution:
> (first column bucket length, second number of buckets with that length)
> 1: 3505
> 2: 1236
> 3: 294
> 4: 52
> 5: 3
> 47: 1 <--- this is the unnamed symbols bucket
> There are still some 5+ buckets, but increasing the hash table
> even more would be likely not worth it.
> This also cleans up the code slightly by removing hard coded
> magic numbers.
> I didn't notice a big performance difference either way
> on my Nehalem system, but I presume it'll help somewhat
> on slower systems.
> scripts/kconfig/expr.h | 5 ++---
> scripts/kconfig/symbol.c | 29 +++++++++++++++++------------
> scripts/kconfig/zconf.tab.c_shipped | 2 +-
> scripts/kconfig/zconf.y | 2 +-
> 4 files changed, 21 insertions(+), 17 deletions(-)
The patch looks ok, but you forgot your Signed-off-by line?
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/