Okay, let's take a look at the case where I have 64 connections open: if
I'm using a 64 entry hash table with one 4 byte pointer per entry and
perfect hashing, then it has a cache footprint of 256 bytes. Max. Now,
the same hash table blown up to 4MB is going to have a cache footprint
of 64 bytes (1 cache line) per entry, for a total of a 4KB cache footprint.
Which is better?
> Let me clue you in. If the hash chains get long, you (instead of
> cache missing on the table itself) are missing the cache several
> times over walking the long hash chains.
Don't AssUMe that I don't realise this. What I'm saying is that a 4MB hash
table for a system with a puny number of connections is bloat. Needless
bloat. 4MB is enough memory for a copy of gcc. Or enough to run 4 shells.
If the hash table was grown dynamically, I wouldn't have this complaint.
-ben
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/