[PR #13686] [MERGED] Use wyhash for <til/hash.h> #29709

Open
opened 2026-01-31 09:36:27 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13686
Author: @lhecker
Created: 8/5/2022
Status: Merged
Merged: 8/10/2022
Merged by: @undefined

Base: mainHead: dev/lhecker/wyhash


📝 Commits (1)

  • 0b0598d Use wyhash for <til/hash.h>

📊 Changes

10 files changed (+440 additions, -77 deletions)

View changed files

📝 .github/actions/spelling/expect/expect.txt (+11 -4)
📝 NOTICE.md (+33 -0)
oss/wyhash/LICENSE (+25 -0)
oss/wyhash/MAINTAINER_README.md (+4 -0)
oss/wyhash/cgmanifest.json (+14 -0)
📝 src/buffer/out/UnicodeStorage.hpp (+2 -3)
📝 src/inc/til/hash.h (+194 -70)
src/til/ut_til/HashTests.cpp (+46 -0)
📝 src/til/ut_til/til.unit.tests.vcxproj (+27 -0)
📝 src/til/ut_til/til.unit.tests.vcxproj.filters (+84 -0)

📄 Description

wyhash was chosen based on the results found in smhasher, were it proved
itself as an algorithm with little flaws and fairly high output quality.

While I have a personal preference for xxhash (XXH3 specifically), wyhash is a
better fit for this project as its source code is multiple magnitudes smaller,
simplifying the review and integration into the header-only hash.h file.

For use with hashmaps the hash quality doesn't actually matter much for
optimal performance and instead the binary size usually matters more.
But even in that scenario wyhash is fairly close to FNV1a (aka "FNV64").

The result is that this new hash algorithm will only have little impact on
hashmap performance if used over the standard FNV1a as used in the STL,
while simultaneously offering a vastly better hash quality.

This partially solves #13124.

Validation Steps Performed

  • Added test cases

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/13686 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 8/5/2022 **Status:** ✅ Merged **Merged:** 8/10/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/wyhash` --- ### 📝 Commits (1) - [`0b0598d`](https://github.com/microsoft/terminal/commit/0b0598d2b352314587847b5c505eac37e8b87a47) Use wyhash for <til/hash.h> ### 📊 Changes **10 files changed** (+440 additions, -77 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/expect/expect.txt` (+11 -4) 📝 `NOTICE.md` (+33 -0) ➕ `oss/wyhash/LICENSE` (+25 -0) ➕ `oss/wyhash/MAINTAINER_README.md` (+4 -0) ➕ `oss/wyhash/cgmanifest.json` (+14 -0) 📝 `src/buffer/out/UnicodeStorage.hpp` (+2 -3) 📝 `src/inc/til/hash.h` (+194 -70) ➕ `src/til/ut_til/HashTests.cpp` (+46 -0) 📝 `src/til/ut_til/til.unit.tests.vcxproj` (+27 -0) 📝 `src/til/ut_til/til.unit.tests.vcxproj.filters` (+84 -0) </details> ### 📄 Description wyhash was chosen based on the results found in `smhasher`, were it proved itself as an algorithm with little flaws and fairly high output quality. While I have a personal preference for xxhash (XXH3 specifically), wyhash is a better fit for this project as its source code is multiple magnitudes smaller, simplifying the review and integration into the header-only `hash.h` file. For use with hashmaps the hash quality doesn't actually matter much for optimal performance and instead the binary size usually matters more. But even in that scenario wyhash is fairly close to FNV1a (aka "FNV64"). The result is that this new hash algorithm will only have little impact on hashmap performance if used over the standard FNV1a as used in the STL, while simultaneously offering a vastly better hash quality. This partially solves #13124. ## Validation Steps Performed * Added test cases ✅ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:36:27 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29709