Skip to content

Commit

Permalink
Upgrade to twoxhash 2.1 and use oneshot API for improved performance
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Dec 13, 2024
1 parent c4dbf0d commit 53b863b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion parquet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ seq-macro = { version = "0.3", default-features = false }
futures = { version = "0.3", default-features = false, features = ["std"], optional = true }
tokio = { version = "1.0", optional = true, default-features = false, features = ["macros", "rt", "io-util"] }
hashbrown = { version = "0.15", default-features = false }
twox-hash = { version = "1.6", default-features = false }
twox-hash = { version = "2.1", default-features = false, features = ["xxhash64"] }
paste = { version = "1.0" }
half = { version = "2.1", default-features = false, features = ["num-traits"] }
sysinfo = { version = "0.32.0", optional = true, default-features = false, features = ["system"] }
Expand Down
5 changes: 1 addition & 4 deletions parquet/src/bloom_filter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ use crate::format::{
};
use crate::thrift::{TCompactSliceInputProtocol, TSerializable};
use bytes::Bytes;
use std::hash::Hasher;
use std::io::Write;
use std::sync::Arc;
use thrift::protocol::{TCompactOutputProtocol, TOutputProtocol};
Expand Down Expand Up @@ -397,9 +396,7 @@ const SEED: u64 = 0;

#[inline]
fn hash_as_bytes<A: AsBytes + ?Sized>(value: &A) -> u64 {
let mut hasher = XxHash64::with_seed(SEED);
hasher.write(value.as_bytes());
hasher.finish()
XxHash64::oneshot(SEED, value.as_bytes())
}

#[cfg(test)]
Expand Down

0 comments on commit 53b863b

Please sign in to comment.