Re: Change GUC hashtable to use simplehash?
John Naylor <johncnaylorls@gmail.com>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Silence warning in older versions of Valgrind
- fde7c0164ea2 17.5 landed
- 0600d276d485 18.0 landed
-
Revert "Speed up tail processing when hashing aligned C strings, take two"
- 6555fe197914 17.3 landed
- 235328ee4ae4 18.0 landed
-
Speed up tail processing when hashing aligned C strings, take two
- a365d9e2e8c1 17.0 landed
-
Teach fasthash_accum to use platform endianness for bytewise loads
- 0c25fee35903 17.0 landed
-
Add macro to disable address safety instrumentation
- db17594ad73a 17.0 landed
-
Convert uses of hash_string_pointer to fasthash equivalent
- f956ecd0353b 17.0 landed
-
Speed up tail processing when hashing aligned C strings
- 07f0f6abfc7f 17.0 landed
-
Add helper functions for dshash tables with string keys.
- 42a1de3013ea 17.0 cited
-
Fix warnings in cpluspluscheck
- 257998508672 17.0 landed
-
Further cosmetic review of hashfn_unstable.h
- b83033c3cff5 17.0 landed
-
Simplify initialization of incremental hash state
- 9ed3ee5001b6 17.0 landed
-
Add optimized C string hashing
- 0aba2554409e 17.0 landed
-
Add inline incremental hash functions for in-memory use
- e97b672c88f6 17.0 landed
-
Make all Perl warnings fatal
- c5385929593d 17.0 cited
On Mon, Dec 4, 2023 at 4:16 AM Jeff Davis <pgsql@j-davis.com> wrote: > I'm trying to follow the distinctions you're making between dynahash > and simplehash -- are you saying it's easier to do incremental hashing > with dynahash, and if so, why? That's a good thing to clear up. This thread has taken simplehash as a starting point from the very beginning. It initially showed no improvement, and then we identified problems with the hashing and equality computations. The latter seem like independently commitable improvements, so I'm curious if they help on their own, even if we still need to switch to simplehash as a last step to meet your performance goals. > If I understood what Andres was saying, the exposed hash state would be > useful for writing a hash function like guc_name_hash(). From my point of view, it would at least be useful for C-strings, where we don't have the length available up front. Aside from that, we have multiple places that compute full 32-bit hashes on multiple individual values, and then combine them with various ad-hoc ways. It could be worth exploring whether an incremental interface would be better in those places on a case-by-case basis. (If Andres had something else in mind, I'll let him address that.) > But whether we > use simplehash or dynahash is a separate question, right? Right, the table implementation should treat the hash function as a black box. Think of the incremental API as lower-level building blocks for building hash functions. > Also, while the |= 0x20 is a nice trick for lowercasing, did we decide > that it's better than my approach in patch 0004 here: > > https://www.postgresql.org/message-id/27a7a289d5b8f42e1b1e79b1bcaeef3a40583bd2.camel@j-davis.com > > which optimizes exact hits (most GUC names are already folded) before > trying case folding? Note there were two aspects there: hashing and equality. I demonstrated in https://www.postgresql.org/message-id/CANWCAZbQ30O9j-bEZ_1zVCyKPpSjwbE4u19cSDDBJ%3DTYrHvPig%40mail.gmail.com ... in v4-0003 that the equality function can be optimized for already-folded names (and in fact measured almost equally) using way, way, way less code.