diff --git a/src/main/rust/Cargo.toml b/src/main/rust/Cargo.toml index d7b4096..cc81dbf 100644 --- a/src/main/rust/Cargo.toml +++ b/src/main/rust/Cargo.toml @@ -50,3 +50,8 @@ harness = false lto = "fat" strip = "symbols" panic = "abort" + +[profile.flamegraph] +inherits = "release" +debug = true +strip = "none" \ No newline at end of file diff --git a/src/main/rust/src/utils/parse.rs b/src/main/rust/src/utils/parse.rs index 9c1023b..8eb9069 100644 --- a/src/main/rust/src/utils/parse.rs +++ b/src/main/rust/src/utils/parse.rs @@ -71,10 +71,10 @@ pub fn temp_simd(bytes: &[u8]) -> isize { #[inline] pub fn hashstr(bytes: &[u8]) -> usize { - let mut hash = 0; + let mut hash: usize = 0; let (chunks, remainder) = bytes.as_chunks::<8>(); for &chunk in chunks { - hash += usize::from_be_bytes(chunk); + hash = hash.wrapping_add(usize::from_be_bytes(chunk)); } let mut r = [0_u8; 8]; r[0] = remainder.len() as u8;