From 3785a87cee5b8f57e805f8f6126a04db8ed78089 Mon Sep 17 00:00:00 2001 From: sreedevk Date: Sun, 13 Jul 2025 12:44:49 +0000 Subject: [PATCH] add more goals to readme --- README.md | 23 ++++++++--------------- src/fileinfo.rs | 10 ++++++---- src/formatter.rs | 14 ++++---------- src/interactive.rs | 9 +++++---- src/main.rs | 6 ++---- 5 files changed, 25 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index dc1402b..b12501b 100644 --- a/README.md +++ b/README.md @@ -110,19 +110,6 @@ Deduplicator uses size comparison and fxhash (a non non-cryptographic hashing al These benchmarks were run using [hyperfine](https://github.com/sharkdp/hyperfine). Here are the specs of the machine used to benchmark deduplicator: -``` -OS: Arch Linux x86_64 -Host: Precision 5540 -Kernel: 5.15.89-1-lts -Uptime: 4 hours, 44 mins -Shell: zsh 5.9 -Terminal: kitty -CPU: Intel i9-9880H (16) @ 4.800GHz -GPU: NVIDIA Quadro T2000 Mobile / Max-Q -GPU: Intel CoffeeLake-H GT2 [UHD Graphics 630] -Memory: 31731MiB (~32GiB) -``` - ## Screenshots ![](https://user-images.githubusercontent.com/36154121/213618143-e5182e39-731e-4817-87dd-1a6a0f38a449.gif) @@ -133,9 +120,15 @@ Memory: 31731MiB (~32GiB) - Packages for different operating system repositories (currently only installable via cargo) ## v0.3 checklist -- [x] parallelization of scanning, processing and formatting +- [x] parallelization + - [x] (scanning) + ((processing sw) & (processing hw) & formatting) + - [ ] (scanning) + ((processing sw + processing hw) & formatting) + - [ ] (scanning) + processing sw + processing hw + formatting - [x] reduce cloning values on the heap - [x] add a partial hashing mode (--strict) - [ ] add an option to use a bloom filter for very large filesystems - [ ] max file path size should use the last set of duplicates -- [ ] add unit tests +- [-] add unit tests +- [ ] add silent mode +- [ ] restore json output +- [ ] update documentation diff --git a/src/fileinfo.rs b/src/fileinfo.rs index 05ab80d..afee963 100644 --- a/src/fileinfo.rs +++ b/src/fileinfo.rs @@ -1,10 +1,12 @@ use anyhow::Result; use gxhash::GxHasher; use memmap2::Mmap; -use std::fs; -use std::hash::Hasher; -use std::io::Read; -use std::{fs::Metadata, path::PathBuf}; +use std::{ + fs::{self, Metadata}, + hash::Hasher, + io::Read, + path::PathBuf, +}; #[derive(Debug, Clone)] pub struct FileInfo { diff --git a/src/formatter.rs b/src/formatter.rs index 5d4f424..b0c5752 100644 --- a/src/formatter.rs +++ b/src/formatter.rs @@ -1,20 +1,14 @@ -pub struct Formatter; -use crate::fileinfo::FileInfo; -use crate::params::Params; +use crate::{fileinfo::FileInfo, params::Params}; use anyhow::Result; use chrono::{DateTime, Utc}; use dashmap::DashMap; -use indicatif::{ - ParallelProgressIterator, ProgressBar, ProgressFinish, ProgressStyle, -}; +use indicatif::{ParallelProgressIterator, ProgressBar, ProgressFinish, ProgressStyle}; use pathdiff::diff_paths; use prettytable::{format, row, Row, Table}; use rayon::prelude::*; -use std::borrow::Cow; -use std::path::PathBuf; -use std::sync::Arc; -use std::time::Duration; +use std::{borrow::Cow, path::PathBuf, sync::Arc, time::Duration}; +pub struct Formatter; impl Formatter { pub fn human_path( file: &FileInfo, diff --git a/src/interactive.rs b/src/interactive.rs index c34aea9..1680906 100644 --- a/src/interactive.rs +++ b/src/interactive.rs @@ -1,10 +1,11 @@ -use crate::formatter::Formatter; -use crate::{fileinfo::FileInfo, params::Params}; +use crate::{fileinfo::FileInfo, formatter::Formatter, params::Params}; use anyhow::Result; use dashmap::DashMap; use prettytable::{format, row, Table}; -use std::io::{self, Write}; -use std::sync::Arc; +use std::{ + io::{self, Write}, + sync::Arc, +}; pub fn scan_group_confirmation() -> Result { print!("\nconfirm? [y/N]: "); diff --git a/src/main.rs b/src/main.rs index cf9402f..6db3852 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,13 +6,11 @@ mod processor; mod scanner; mod server; -use std::sync::atomic::Ordering; - -use self::formatter::Formatter; -use self::server::Server; +use self::{formatter::Formatter, server::Server}; use anyhow::Result; use clap::Parser; use params::Params; +use std::sync::atomic::Ordering; fn main() -> Result<()> { let app_args = Params::parse();