diff options
| author | Heikki Linnakangas | 2023-11-08 11:30:52 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2023-11-08 11:30:52 +0000 |
| commit | 954e43564d9920f0a98e3b750e0c74bb035410f5 (patch) | |
| tree | 4736ac4d3f41055e788531b8a4c2814da1142a6e /src/include | |
| parent | b8bff07daa85c837a2747b4d35cd5a27e73fb7b2 (diff) | |
Use a faster hash function in resource owners.
This buys back some of the performance loss that we otherwise saw from the
previous commit.
Reviewed-by: Aleksander Alekseev, Michael Paquier, Julien Rouhaud
Reviewed-by: Kyotaro Horiguchi, Hayato Kuroda, Álvaro Herrera, Zhihong Yu
Reviewed-by: Peter Eisentraut, Andres Freund
Discussion: https://www.postgresql.org/message-id/d746cead-a1ef-7efe-fb47-933311e876a3%40iki.fi
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/common/hashfn.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/include/common/hashfn.h b/src/include/common/hashfn.h index 5e89aef987f..adc1dc1de89 100644 --- a/src/include/common/hashfn.h +++ b/src/include/common/hashfn.h @@ -101,4 +101,19 @@ murmurhash32(uint32 data) return h; } +/* 64-bit variant */ +static inline uint64 +murmurhash64(uint64 data) +{ + uint64 h = data; + + h ^= h >> 33; + h *= 0xff51afd7ed558ccd; + h ^= h >> 33; + h *= 0xc4ceb9fe1a85ec53; + h ^= h >> 33; + + return h; +} + #endif /* HASHFN_H */ |
