diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml deleted file mode 100644 index 4a2b97e..0000000 --- a/.github/workflows/build_and_release.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build and release - -on: - push: - branches: - - main - release: - types: [created] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: Build for Windows - run: | - cargo build --release --target x86_64-pc-windows-gnu - - - name: Build for Linux - run: | - cargo build --release --target x86_64-unknown-linux-gnu - - - name: Build for MacOS - run: | - cargo build --release --target x86_64-apple-darwin - - - name: Create release - uses: actions/create-release@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cd21307 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +env: + PROJECT_NAME: deduplicator + PROJECT_DESC: "Filter, Sort & Delete Duplicate Files Recursively" + PROJECT_AUTH: "sreedevk" + +on: + release: + types: + - created + +jobs: + upload-assets: + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: taiki-e/upload-rust-binary-action@v1 + with: + bin: deduplicator + tar: unix + zip: windows + token: ${{ secrets.GITHUB_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index aff1ed5..345ad75 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target /test_data +.envrc diff --git a/README.md b/README.md index e5502b9..ca11908 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,7 @@ Find, Sort, Filter & Delete duplicate files

-

-NOTE: This project is still being developed. At the moment, as shown in the screenshot below, deduplicator is able to scan through and list duplicates with and without caching. Contributions are welcome. -

- -

Usage

+## Usage ```bash Usage: deduplicator [OPTIONS] @@ -22,27 +18,83 @@ Options: -V, --version Print version information ``` -

Installation

+## Installation -

Currently, deduplicator is only installable via rust's cargo package manager

+### Cargo Install + +#### Stable + +```bash +$ cargo install deduplicator +``` + +#### Nightly + +if you'd like to install with nightly features, you can use + +```bash +$ cargo install --git https://github.com/sreedevk/deduplicator +``` +Please note that if you use a version manager to install rust (like asdf), you need to reshim (`asdf reshim rust`). + +### Linux (Pre-built Binary) + +you can download the pre-built binary from the [Releases](https://github.com/sreedevk/deduplicator/releases) page. +download the `deduplicator-x86_64-unknown-linux-gnu.tar.gz` for linux. Once you have the tarball file with the executable, +you can follow these steps to install: + +```bash +$ tar -zxvf deduplicator-x86_64-unknown-linux-gnu.tar.gz +$ sudo mv deduplicator /usr/bin/ +``` + +### Mac OS (Pre-built Binary) + +you can download the pre-build binary from the [Releases](https://github.com/sreedevk/deduplicator/releases) page. +download the `deduplicator-x86_64-apple-darwin.tar.gz` tarball for mac os. Once you have the tarball file with the executable, you can follow these steps to install: + +```bash +$ tar -zxvf deduplicator-x86_64-unknown-linux-gnu.tar.gz +$ sudo mv deduplicator /usr/bin/ +``` + +### Windows (Pre-built Binary) + +you can download the pre-build binary from the [Releases](https://github.com/sreedevk/deduplicator/releases) page. +download the `deduplicator-x86_64-pc-windows-msvc.zip` zip file for windows. unzip the `zip` file & move the `deduplicator.exe` to a location in the PATH system environment variable. + +Note: If you Run into an msvc error, please install MSCV from [here](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) + +## Performance + +Deduplicator uses size comparison and fxhash (a non non-cryptographic hashing algo) to quickly scan through large number of files to find duplicates. its also highly parallel (uses rayon and dashmap). I was able to scan through 120GB of files (Videos, PDFs, Images) in ~300ms. checkout the benchmarks + +## benchmarks + +| Command | Dirsize | Mean [ms] | Min [ms] | Max [ms] | Relative | +|:---|:---|---:|---:|---:|---:| +| `deduplicator --dir ~/Data/tmp` | (~120G) | 27.5 ± 1.0 | 26.0 | 32.1 | 1.70 ± 0.09 | +| `deduplicator --dir ~/Data/books` | (~8.6G) | 21.8 ± 0.7 | 20.5 | 24.4 | 1.35 ± 0.07 | +| `deduplicator --dir ~/Data/books --minsize 10M` | (~8.6G) | 16.1 ± 0.6 | 14.9 | 18.8 | 1.00 | +| `deduplicator --dir ~/Data/ --types pdf,jpg,png,jpeg` | (~290G) | 1857.4 ± 24.5 | 1817.0 | 1895.5 | 115.07 ± 4.64 | + +* The last entry is lower because of the number of files deduplicator had to go through (~660895 Files). The average size of the files rarely affect the performance of deduplicator. + +These benchmarks were run using [hyperfine](https://github.com/sharkdp/hyperfine). Here are the specs of the machine used to benchmark deduplicator: ``` -cargo install 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) ``` -

- note that if you use a version manager to install rust (like asdf), you need to reshim (`asdf reshim rust`). -

-

Performance

+## Screenshots -

- Deduplicator uses fxhash (a non-cryptographic hashing algorithm) which is extremely fast. As a result, deduplicator is able to process huge amounts of data in a couple of seconds. few milliseconds.

- -

- While testing, Deduplicator was able to go through 8.6GB of pdf files and detect duplicates in 2.9 seconds - As of version 0.1.1, on testing locally, deduplicator was able to process and find duplicates in 120GB of files (Videos, PDFs, Images) in ~300ms -

- -

Screenshots

- - +![](https://user-images.githubusercontent.com/36154121/213618143-e5182e39-731e-4817-87dd-1a6a0f38a449.gif)