diff options
author | 2023-11-11 03:54:18 +0100 | |
---|---|---|
committer | 2023-11-11 03:54:18 +0100 | |
commit | 53f5f935e493cce3c041f8d0a635ab4c24a8f7e0 (patch) | |
tree | 663740eb773a2274777873647e634932399f1756 /graphics | |
parent | 751ea77c29f6eb3d00f45f0a04c833a1d03a425c (diff) | |
parent | 107e842071f1300df5e0bfcb26ee0a99024e51d8 (diff) | |
download | iced-53f5f935e493cce3c041f8d0a635ab4c24a8f7e0.tar.gz iced-53f5f935e493cce3c041f8d0a635ab4c24a8f7e0.tar.bz2 iced-53f5f935e493cce3c041f8d0a635ab4c24a8f7e0.zip |
Merge pull request #2080 from dtzxporter/xxhash-3-speed
Migrate twox-hash -> xxhash-rust. Switch to Xxh3 for better performance.
Diffstat (limited to '')
-rw-r--r-- | graphics/Cargo.toml | 6 | ||||
-rw-r--r-- | graphics/src/text/cache.rs | 6 |
2 files changed, 2 insertions, 10 deletions
diff --git a/graphics/Cargo.toml b/graphics/Cargo.toml index 3165810b..a7aea352 100644 --- a/graphics/Cargo.toml +++ b/graphics/Cargo.toml @@ -33,8 +33,8 @@ once_cell.workspace = true raw-window-handle.workspace = true rustc-hash.workspace = true thiserror.workspace = true -twox-hash.workspace = true unicode-segmentation.workspace = true +xxhash-rust.workspace = true image.workspace = true image.optional = true @@ -44,7 +44,3 @@ kamadak-exif.optional = true lyon_path.workspace = true lyon_path.optional = true - -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -twox-hash.workspace = true -twox-hash.features = ["std"] diff --git a/graphics/src/text/cache.rs b/graphics/src/text/cache.rs index b3293dd4..7fb33567 100644 --- a/graphics/src/text/cache.rs +++ b/graphics/src/text/cache.rs @@ -16,11 +16,7 @@ pub struct Cache { hasher: HashBuilder, } -#[cfg(not(target_arch = "wasm32"))] -type HashBuilder = twox_hash::RandomXxHashBuilder64; - -#[cfg(target_arch = "wasm32")] -type HashBuilder = std::hash::BuildHasherDefault<twox_hash::XxHash64>; +type HashBuilder = xxhash_rust::xxh3::Xxh3Builder; impl Cache { /// Creates a new empty [`Cache`]. |