model-writtenrun 2565 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Nov 2023 - Apr 2024 · 26 entries
- Jeff Davis opened the thread with a simplehash conversion of the GUC table, reporting a cleaner API but no measurable speedup in #1.
- Tom Lane argued that simplehash could not replace every hash table, while Andres Freund identified GUC workloads worth optimizing; Jeff initially withdrew the conversion pending a concrete benefit in #4, #5, and #6.
- Andres found poor bit mixing and excessive collisions in guc_name_hash, motivating Jeff's experiments with early case folding, second-chance lookup, and stored hashes in #9 and #12.
- John Naylor measured the added strlen cost, supplied a finalizer fix, and replaced caller-side folding with lazy comparison and branchless hash folding in #13 and #16; Jeff subsequently accepted keeping case handling inside the hash and comparison functions in #31.
- Andres's review called for a proper incremental hashing API instead of an ad hoc GUC hash, and John responded with an MIT-licensed fasthash implementation in a deliberately unstable, in-memory-only header in #21 and #23.
- Heikki Linnakangas supported the initial implementation, while Jeff found a missing pointer increment; John then rebuilt the incremental interfaces with original-output validation and GUC, dynahash, and pgstat experiments in #24, #33, and #35.
- Jeff reported that separate GUC caching work had solved his original proconfig performance problem, leaving the table conversion without its original benchmark justification while the general hashing API remained useful in #34.
- Jeff supplied a search-path-cache consumer, and John made that the principal validation and performance example, temporarily removing GUC experiments and fixing unaligned loads that upset CI in #36 and #38.
- Benchmarks favored chunkwise processing over the bytewise interface, and SMHasher showed that incorporating string length into the finalizer restored hash quality when the length was unknown initially in #39 and #40.
- After John consolidated the API and examples in #41, Jeff supplied aligned word-at-a-time string processing in #42, which John incorporated with BSD-inspired tail detection in #45.
- John generalized string accumulation into hashfn_unstable.h, added big-endian handling and faster four-byte tail loads, and supplied benchmarks that were explicitly not intended for commit in #46.
- Jian He's apparent performance regressions were traced to development-build settings, with release measurements confirming improvements; Junwang Zhao also caught copyright issues before John consolidated the work into two polished patches in #49, #50, #53, #55, and #57.
- The first component of #57 landed as e97b672c88 with Heikki's stability-warning rewrite, and its unchanged C-string component landed as 0aba255440, crediting Jeff and John for the implementation.
- Heikki's questions about seeds and finalizer tweaks and Jeff's questions about zero-byte detection prompted further API explanation, initialization simplification, and renewed GUC/dynahash consumers in #60, #65, and #66.
- Ants Aasma supplied an aligned-tail masking optimization and an unaligned-word experiment in #68; John retained the simple unaligned fallback and revised the aligned mask, then incorporated Ants's correctness feedback in #69, #70, and #71.
- The initialization and documentation components of #66 landed separately as 9ed3ee5001 and b83033c3cf, with additional comment polish, while #72 retained the pending consumers and tail optimization.
- Peter Eisentraut reported C++ signedness warnings and recommended size_t in #73; John implemented that discussion directly in 2579985086 and confirmed it in #74.
- After a gap, John rebased the tail work and added frontend string-hash and resource-owner examples, while postponing the dynahash change to investigate truncation requirements in #75.
- Frontend testing exposed address-sanitizer complaints about aligned reads beyond the string terminator; Jeff supported a function-level exclusion and corrected its Clang spelling, leading to the revised series in #76, #77, and #78.
- The tail component of #78 landed unchanged as 07f0f6abfc, using a mask derived directly from zero-byte detection.
- John reported reverting that optimization because aligned and unaligned paths could produce different hashes, with an additional Valgrind issue still unresolved, in #81.
- The sanitizer component of #78 landed as db17594ad7, and its frontend conversions landed as f956ecd035 after Jeff's suggestion in #79 moved hash_string into an inline header helper and the blkreftable conversion was omitted.
- John fixed bytewise accumulation to follow native endianness in 0c25fee359, addressing the equivalence problem discussed in #81 and reported resolved in #82.
- The second tail landing, a365d9e2e8, returned to Ants's explicit length-based mask retained in the first component of #71, with cosmetic adjustments and the new endianness prerequisite; John reported that this form passed his local Valgrind testing in #82.
- John also revived bounded string hashing for both dynahash and dshash in #82, leaving the compatibility and deprecation wording around string_hash unresolved; the earlier resource-owner experiment was no longer included.
- At the thread's end, the reusable hashing API, its pgstat and search-path consumers, frontend conversions, and Valgrind repair had landed, while the original GUC table conversion remained unsubstantiated by a new benchmark and the dynahash/dshash proposal in #82 had no recorded landing.
Dec 2024 - Feb 2025 · 6 entries
- Months later, Anton A. Melnikov reported an initdb failure under Valgrind and identified an older Valgrind version, while John proposed using the unaligned fallback specifically in Valgrind builds in #83, #86, and #85.
- Anton instead supplied a narrower byte-counting fix in #87; Tom Lane rejected conditionally hiding the original code from Valgrind in #88, and Anton made the replacement unconditional in #89.
- John preferred reverting the tail optimization, and Anton supported reverting in principle; that discussion produced 235328ee4a, backpatched to version 17 and announced in #93, without applying the attached byte-counting patches.
- Anton showed that the revert still left the problematic bit scan and rebased his fix in #94; the ensuing clarification established that his earlier testing had covered an older implementation rather than the specific proposed revert in #96 and #97.
- John replaced both the bit scan and tail accumulation with the existing unaligned helper in #99, and Anton verified that this eliminated the Valgrind errors and improved generated code in #100.
- That tested repair landed as 0600d276d4 with removal of redundant endian handling and comments, was backpatched to version 17, and closed the bugfix exchange with John's confirmation and Anton's thanks in #102 and #103.