-
Notifications
You must be signed in to change notification settings - Fork 1.1k
wayland: Move hash algorithm to foldhash #4448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
a0476af to
190a88d
Compare
|
cc @kchibisov, I know this is performance-sensitive for |
|
Hmm, looks like CI is failing because |
190a88d to
0f90aa2
Compare
| //! * `wayland-csd-adwaita-notitle`. | ||
| //! * `wayland-csd-adwaita-notitlebar`. | ||
| #![allow(clippy::mutable_key_type)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: See if there's a way to resolve this from the wayland-rs end
winit code is not perf sensitive to alacritty, but we do use ahash in alacritty and it demonstrated to be faster than other algs. |
|
Was foldhash included in those tests? |
|
I think not, I'll retest, but winit can use anything pretty much. |
At the moment, the wayland code uses ahash to perform hashing in its various hash mas. This was done because ahash was seen as the best default in the Rust community at the time. However, most Rust crates (including `hashbrown`) have since moved to using foldhash instead. This move is done for two primary reasons: - This reduces the number of dependencies in the tree for most GUI projects. As other projects use foldhash now, this removes ahash (as well as its five dependencies) from the tree. - In most cases, foldhash is faster than ahash. Signed-off-by: John Nunley <[email protected]>
Signed-off-by: John Nunley <[email protected]>
53e0bec to
35b6f44
Compare
A few years ago, I asked if we should use a different hash algorithm for our hash maps in the Wayland backend. We decided on using
ahash, given thatit was the default in
hashbrownat the time.However,
hashbrownhas since moved tofoldhash, along with the rest of the Rust community. So this PR moves this crate tofoldhashas well.This move is done for two primary reasons:
This reduces the number of dependencies in the tree for most GUI
projects. As other projects use foldhash now, this removes ahash
(as well as its five dependencies) from the tree.
In most cases, foldhash is faster than ahash.
Tested on all platforms changed
Added an entry to the
changelogmodule if knowledge of this change could be valuable to usersUpdated documentation to reflect any user-facing changes, including notes of platform-specific behavior
Created or updated an example program if it would help users understand this functionality