util/hash_table: replace _mesa_hash_data's fnv1a hash function with xxhash
authorAnthony Pesch <inolen@gmail.com>
Sat, 18 Jan 2020 05:54:10 +0000 (00:54 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 23 Jan 2020 17:06:57 +0000 (17:06 +0000)
commit931388ceca323750682604c7b70d355fa00d9900
tree6f466ae8ef362de5afb06dbadd5b9195852aa33a
parent032f8807f7c1aa2d0c973b6664b9ab6be6863e90
util/hash_table: replace _mesa_hash_data's fnv1a hash function with xxhash

For most key sizes, xxhash outperforms fnv1a's hash rate substantially (bug
2153). In particular, the V3D driver hashes multiple ~200 byte keys as part
of the shader cache lookup which can easily eat up 10-20% of the runtime on
the Raspberry Pi. Swapping over to xxhash drops this to ~1% of the runtime.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3475>
src/util/hash_table.c