Skip to content

Commit

Permalink
xxh3_64()
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Jul 2, 2024
1 parent 7b081e1 commit e34d933
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 85 deletions.
81 changes: 4 additions & 77 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ optimize = []
strict_provenance = []

[dependencies]
ahash = { version = "^0.8.9", default-features = false, features = ["compile-time-rng"] }
arrayvec = { version = "0.7", default-features = false, features = ["std", "serde"] }
associative-cache = { version = "2", default-features = false }
beef = { version = "0.5", default-features = false, features = ["impl_serde"] }
Expand All @@ -67,14 +66,15 @@ encoding_rs = { version = "0.8", default-features = false }
half = { version = "2", default-features = false, features = ["std"] }
itoa = { version = "1", default-features = false }
itoap = { version = "1", features = ["std", "simd"] }
once_cell = { version = "1", default-features = false, features = ["race"] }
once_cell = { version = "1", default-features = false, features = ["alloc", "race"] }
pyo3-ffi = { version = "^0.21", default-features = false, features = ["extension-module"]}
ryu = { version = "1", default-features = false }
serde = { version = "1", default-features = false }
serde_json = { version = "1", default-features = false, features = ["std", "float_roundtrip"] }
simdutf8 = { version = "0.1", default-features = false, features = ["std", "aarch64_neon"] }
simdutf8 = { version = "0.1", default-features = false, features = ["std", "public_imp", "aarch64_neon"] }
smallvec = { version = "^1.11", default-features = false, features = ["union", "write"] }
unwinding = { version = "0.2", features = ["unwinder"], optional = true }
xxhash-rust = { version = "^0.8", default-features = false, features = ["xxh3"] }

[build-dependencies]
cc = { version = "1" }
Expand Down
6 changes: 1 addition & 5 deletions src/deserialize/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use associative_cache::{AssociativeCache, Capacity2048, HashDirectMapped, RoundRobinReplacement};
use core::ffi::c_void;
use once_cell::unsync::OnceCell;
use std::hash::Hasher;

#[repr(transparent)]
pub struct CachedKey {
Expand Down Expand Up @@ -40,9 +39,6 @@ pub static mut KEY_MAP: OnceCell<KeyMap> = OnceCell::new();

#[inline(always)]
pub fn cache_hash(key: &[u8]) -> u64 {
// try to omit code for >64 path in ahash
assume!(key.len() <= 64);
let mut hasher = ahash::AHasher::default();
hasher.write(key);
hasher.finish()
xxhash_rust::xxh3::xxh3_64(key)
}

0 comments on commit e34d933

Please sign in to comment.