Removed FnvHash and transformed the rest to FxHashmap (#39233)

This should be the final PR for the Hash Function series that is
trivial.

Of note: I decided to transform `HashMapTracedValues<Atom,..>` to use
FxBuildHasher. This is likely not going to improve performance as Atom's
already have a unique u32 that is used as the Hash but it safes a few
bytes for the RandomState that is normally in the HashMap.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>

Testing: Hash function changes should not change functionality, we
slightly decrease the size and unit tests still work.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
Narfinger 2025-09-10 15:34:54 +02:00 committed by GitHub
parent 726b456120
commit 84465e7768
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
55 changed files with 211 additions and 202 deletions

View file

@ -20,7 +20,6 @@ compositing_traits = { workspace = true }
constellation_traits = { workspace = true }
embedder_traits = { workspace = true }
euclid = { workspace = true }
fnv = { workspace = true }
fonts = { path = "../../fonts" }
fonts_traits = { workspace = true }
html5ever = { workspace = true }

View file

@ -28,7 +28,6 @@ use constellation_traits::LoadData;
use embedder_traits::{Cursor, Theme, UntrustedNodeAddress, ViewportDetails};
use euclid::Point2D;
use euclid::default::{Point2D as UntypedPoint2D, Rect};
use fnv::FnvHashMap;
use fonts::{FontContext, SystemFontServiceProxy};
pub use layout_damage::LayoutDamage;
use libc::c_void;
@ -288,7 +287,7 @@ pub trait Layout {
/// Set the scroll states of this layout after a compositor scroll.
fn set_scroll_offsets_from_renderer(
&mut self,
scroll_states: &FnvHashMap<ExternalScrollId, LayoutVector2D>,
scroll_states: &FxHashMap<ExternalScrollId, LayoutVector2D>,
);
/// Get the scroll offset of the given scroll node with id of [`ExternalScrollId`] or `None` if it does
@ -425,7 +424,7 @@ pub struct IFrameSize {
pub viewport_details: ViewportDetails,
}
pub type IFrameSizes = FnvHashMap<BrowsingContextId, IFrameSize>;
pub type IFrameSizes = FxHashMap<BrowsingContextId, IFrameSize>;
bitflags! {
/// Conditions which cause a [`Document`] to need to be restyled during reflow, which