[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FW: [Bug-gnubg] Simple multi-threading... Cache
From: |
Jonathan Kinsey |
Subject: |
Re: FW: [Bug-gnubg] Simple multi-threading... Cache |
Date: |
Wed, 24 Jan 2007 16:45:24 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.0 |
Øystein Johansen wrote:
> Jonathan Kinsey wrote:
>
>> The current cache has a simple "two slot" approach, in that if a hash
>> clashes the old hit is put in a back up slot; furthermore if the 2nd
>> slot is hit then it's swapped with the 1st.
>
> I haven't browsed the cache code much, this sounds more like a cuckoo
> scheme to me.
It's fine, hash functions often have collisions and storing more than
one entry at a hash is normal.
I've tested the single slot approach and it's 5-10% worse, which is
bad... So even though there's twice the number of slots the hash
function isn't perfect. It suggests to me that using 3 or 4 slots per
hash might be better. Or we need to alter the hash function to improve
the spread, although it looks fine at a quick glance and these things
are tricky to adjust.
It's looking like we may have to have a cache per thread after all, I
wonder how many duplicate evaluations this will involve - quite a few
I'd think...
Jon
signature.asc
Description: OpenPGP digital signature