version 0.2.2 (#59)

* replaced fxhash with gxhash
This commit is contained in:
Sreedev Kodichath
2024-07-04 23:23:01 -04:00
committed by GitHub
parent a56d194ee3
commit 028b868ea9
5 changed files with 285 additions and 401 deletions

2
.cargo/config.toml Normal file
View File

@@ -0,0 +1,2 @@
[build]
rustflags = ["-C", "target-feature=+aes,+sse2"]

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
/target
/Cargo.lock
/result-bin

672
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
[package]
name = "deduplicator"
version = "0.2.1"
version = "0.2.2"
edition = "2021"
description = "find,filter,delete Duplicates"
repository = "https://github.com/sreedevk/deduplicator"
@@ -20,8 +20,8 @@ chrono = "0.4.23"
clap = { version = "4.0.32", features = ["derive"] }
colored = "2.0.0"
dashmap = { version = "5.4.0", features = ["rayon"] }
fxhash = "0.2.1"
globwalk = "0.8.1"
gxhash = "3.4.1"
indicatif = { version = "0.17.2", features = ["rayon"] }
itertools = "0.10.5"
memmap2 = "0.5.8"
@@ -41,7 +41,7 @@ inherits = "release"
lto = "thin"
[workspace.metadata.dist]
rust-toolchain-version = "1.71.0"
rust-toolchain-version = "1.78.0"
ci = ["github"]
targets = ["x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "aarch64-apple-darwin"]
cargo-dist-version = "0.0.7"

View File

@@ -1,9 +1,10 @@
use anyhow::Result;
use gxhash::GxHasher;
use memmap2::Mmap;
use serde::Serialize;
use std::fs;
use std::hash::Hasher;
use std::{fs::Metadata, path::PathBuf};
use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
pub struct FileInfo {
@@ -18,7 +19,7 @@ impl FileInfo {
pub fn hash(&self) -> Result<Self> {
let file = fs::File::open(self.path.clone())?;
let mapper = unsafe { Mmap::map(&file)? };
let mut primhasher = fxhash::FxHasher::default();
let mut primhasher = GxHasher::default();
mapper
.chunks(1_000_000)