switch to fxhash

This commit is contained in:
2025-09-21 16:27:36 -04:00
parent bc9a273831
commit c1f0b16f20
6 changed files with 23 additions and 6 deletions

16
Cargo.lock generated
View File

@@ -256,6 +256,12 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]] [[package]]
name = "byteorder-lite" name = "byteorder-lite"
version = "0.1.0" version = "0.1.0"
@@ -676,6 +682,15 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
[[package]]
name = "fxhash"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
dependencies = [
"byteorder",
]
[[package]] [[package]]
name = "gethostname" name = "gethostname"
version = "0.4.3" version = "0.4.3"
@@ -2352,6 +2367,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"cosmic-text", "cosmic-text",
"fxhash",
"image", "image",
"pollster", "pollster",
"unicode-segmentation", "unicode-segmentation",

View File

@@ -13,4 +13,5 @@ bytemuck = "1.23.1"
image = "0.25.6" image = "0.25.6"
cosmic-text = "0.14.2" cosmic-text = "0.14.2"
unicode-segmentation = "1.12.0" unicode-segmentation = "1.12.0"
fxhash = "0.2.1"

View File

@@ -55,7 +55,7 @@ impl<'a> PainterCtx<'a> {
textures, textures,
text, text,
screen_size, screen_size,
drawing: HashSet::new(), drawing: HashSet::default(),
} }
} }

View File

@@ -60,7 +60,7 @@ impl TextData {
attrs: &TextAttrs, attrs: &TextAttrs,
textures: &mut Textures, textures: &mut Textures,
) -> (TextureHandle, TextOffset) { ) -> (TextureHandle, TextOffset) {
let mut pixels = HashMap::new(); let mut pixels = HashMap::default();
let mut min_x = 0; let mut min_x = 0;
let mut min_y = 0; let mut min_y = 0;
let mut max_x = 0; let mut max_x = 0;

View File

@@ -236,7 +236,7 @@ impl Widgets {
pub fn new() -> Self { pub fn new() -> Self {
Self { Self {
ids: IdTracker::default(), ids: IdTracker::default(),
map: HashMap::new(), map: HashMap::default(),
} }
} }
@@ -298,7 +298,7 @@ impl Widgets {
WidgetData { WidgetData {
widget, widget,
label, label,
sized_children: HashSet::new(), sized_children: HashSet::default(),
borrowed: false, borrowed: false,
sensor: false, sensor: false,
}, },

View File

@@ -10,5 +10,5 @@ pub(crate) use id::*;
pub(crate) use math::*; pub(crate) use math::*;
pub(crate) use refcount::*; pub(crate) use refcount::*;
pub type HashMap<K, V> = std::collections::HashMap<K, V>; pub type HashMap<K, V> = fxhash::FxHashMap<K, V>;
pub type HashSet<K> = std::collections::HashSet<K>; pub type HashSet<K> = fxhash::FxHashSet<K>;