diff options
author | Anthony Pesch <[email protected]> | 2020-01-18 01:38:31 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-23 17:06:57 +0000 |
commit | 1496cc92f6f743f10e1f3c9c63787d79febfda40 (patch) | |
tree | 939b50bbe89f30dd8834380a74f78bc814206d47 /src/mesa | |
parent | 931388ceca323750682604c7b70d355fa00d9900 (diff) |
util/hash_table: added hash functions for integer types
A few hash_table users roll their own integer hash functions which
call _mesa_hash_data to perform the hashing which ultimately calls
into XXH32 with a dynamic key length. When using small keys with a
constant size the hash rate can be greatly improved by inlining
XXH32 and providing it a constant key length, see:
https://fastcompression.blogspot.com/2018/03/xxhash-for-small-keys-impressive-power.html
Additionally, this patch removes calls to _mesa_key_hash_string and
makes them instead call _mesa_has_string directly, matching the new
integer hash functions.
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3475>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/program/symbol_table.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/program/symbol_table.c b/src/mesa/program/symbol_table.c index 0dcb1f292c9..ae7a1175e40 100644 --- a/src/mesa/program/symbol_table.c +++ b/src/mesa/program/symbol_table.c @@ -292,7 +292,7 @@ _mesa_symbol_table_ctor(void) struct _mesa_symbol_table *table = calloc(1, sizeof(*table)); if (table != NULL) { - table->ht = _mesa_hash_table_create(NULL, _mesa_key_hash_string, + table->ht = _mesa_hash_table_create(NULL, _mesa_hash_string, _mesa_key_string_equal); _mesa_symbol_table_push_scope(table); |