From 02f70aa55f9d152170dd276faa6e91d92b9e346c Mon Sep 17 00:00:00 2001 From: sreedev Date: Mon, 23 Jan 2023 02:28:57 -0500 Subject: [PATCH 1/8] updated release github actions --- .github/workflows/build_and_release.yml | 44 ------------------------- .github/workflows/release.yml | 30 +++++++++++++++++ 2 files changed, 30 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/build_and_release.yml create mode 100644 .github/workflows/release.yml 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..405c05c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Release +on: + push: + branches: [main] + release: + types: [created] + +jobs: + release: + name: release ${{ matrix.target }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-pc-windows-gnu + archive: zip + - target: x86_64-unknown-linux-musl + archive: tar.gz tar.xz tar.zst + - target: x86_64-apple-darwin + archive: zip + steps: + - uses: actions/checkout@master + - name: Compile and release + uses: rust-build/rust-build.action@v1.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + RUSTTARGET: ${{ matrix.target }} + ARCHIVE_TYPES: ${{ matrix.archive }} From 96337b6b4897d571b0094180f08936e1c773ccaa Mon Sep 17 00:00:00 2001 From: sreedev Date: Mon, 23 Jan 2023 02:39:37 -0500 Subject: [PATCH 2/8] artifacts upload options added to github workflows --- .github/workflows/release.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 405c05c..e90521b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,10 +21,17 @@ jobs: archive: zip steps: - uses: actions/checkout@master - - name: Compile and release + - name: Compile uses: rust-build/rust-build.action@v1.4.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: RUSTTARGET: ${{ matrix.target }} ARCHIVE_TYPES: ${{ matrix.archive }} + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: Binary + path: | + ${{ steps.compile.outputs.BUILT_ARCHIVE }} + ${{ steps.compile.outputs.BUILT_CHECKSUM }} From b12b662ba1daed7432f8f1d144f2e558f970776e Mon Sep 17 00:00:00 2001 From: sreedev Date: Mon, 23 Jan 2023 03:19:57 -0500 Subject: [PATCH 3/8] workflow updates --- .github/workflows/release.yml | 59 +++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e90521b..89da23e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,37 +1,42 @@ name: Release + +env: + PROJECT_NAME: deduplicator + PROJECT_DESC: "Filter, Sort & Delete Duplicate Files Recursively" + PROJECT_AUTH: "sreedevk" + on: + pull_request: + branches: [main] push: branches: [main] - release: - types: [created] jobs: - release: - name: release ${{ matrix.target }} + create-release: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-pc-windows-gnu - archive: zip - - target: x86_64-unknown-linux-musl - archive: tar.gz tar.xz tar.zst - - target: x86_64-apple-darwin - archive: zip steps: - - uses: actions/checkout@master - - name: Compile - uses: rust-build/rust-build.action@v1.4.0 + - uses: actions/checkout@v3 + - uses: taiki-e/create-gh-release-action@v1.6.2 + with: + changelog: CHANGELOG.md + token: ${{ secrets.GITHUB_TOKEN }} + branch: main + + 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 }} - with: - RUSTTARGET: ${{ matrix.target }} - ARCHIVE_TYPES: ${{ matrix.archive }} - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: Binary - path: | - ${{ steps.compile.outputs.BUILT_ARCHIVE }} - ${{ steps.compile.outputs.BUILT_CHECKSUM }} From 1a573fbf3fe6b901ae2894f87739ec7ec9177eb3 Mon Sep 17 00:00:00 2001 From: sreedev Date: Mon, 23 Jan 2023 03:24:12 -0500 Subject: [PATCH 4/8] release github flow changes --- .github/workflows/release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 89da23e..353129c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,10 +6,9 @@ env: PROJECT_AUTH: "sreedevk" on: - pull_request: - branches: [main] push: - branches: [main] + tags: + - "[0-9]+.*" jobs: create-release: From fd1d214d629b75c9ea66c68a67bf8e32a7899ac6 Mon Sep 17 00:00:00 2001 From: sreedev Date: Mon, 23 Jan 2023 03:36:47 -0500 Subject: [PATCH 5/8] updated github workflows --- .github/workflows/release.yml | 16 +++------------- .gitignore | 1 + 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 353129c..cd21307 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,21 +6,11 @@ env: PROJECT_AUTH: "sreedevk" on: - push: - tags: - - "[0-9]+.*" + release: + types: + - created jobs: - create-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: taiki-e/create-gh-release-action@v1.6.2 - with: - changelog: CHANGELOG.md - token: ${{ secrets.GITHUB_TOKEN }} - branch: main - upload-assets: strategy: matrix: diff --git a/.gitignore b/.gitignore index aff1ed5..345ad75 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target /test_data +.envrc From fd4e882aa83ff97d296c39a8a39723be523bf27d Mon Sep 17 00:00:00 2001 From: sreedev Date: Mon, 23 Jan 2023 14:54:19 -0500 Subject: [PATCH 6/8] updated README --- README.md | 64 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index e5502b9..91fa4c6 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,55 @@ 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 ``` -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 ``` -

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

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

Performance

+### Linux (Pre-built Binary) -

- 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.

+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: -

- 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 -

+```bash +$ tar -zxvf deduplicator-x86_64-unknown-linux-gnu.tar.gz +$ sudo mv deduplicator /usr/bin/ +``` -

Screenshots

+### Mac OS - +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 + +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. + +## 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 haven't uploaded the benchmarks yet, but I was able to scan through 120GB of files (Videos, PDFs, Images) in ~300ms. + +## Screenshots + +![](https://user-images.githubusercontent.com/36154121/213618143-e5182e39-731e-4817-87dd-1a6a0f38a449.gif) From 76c69ef8a0f29a23c7b306dfdfa97da704ef1c4b Mon Sep 17 00:00:00 2001 From: Sreedev Kodichath Date: Mon, 23 Jan 2023 15:14:31 -0500 Subject: [PATCH 7/8] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 91fa4c6..03d45ad 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ $ tar -zxvf deduplicator-x86_64-unknown-linux-gnu.tar.gz $ sudo mv deduplicator /usr/bin/ ``` -### Mac OS +### 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: @@ -58,11 +58,13 @@ $ tar -zxvf deduplicator-x86_64-unknown-linux-gnu.tar.gz $ sudo mv deduplicator /usr/bin/ ``` -### Windows +### 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 haven't uploaded the benchmarks yet, but I was able to scan through 120GB of files (Videos, PDFs, Images) in ~300ms. From c6318a310b1ee1e03ce6b360dfdf35f479fdc419 Mon Sep 17 00:00:00 2001 From: sreedev Date: Mon, 23 Jan 2023 15:37:13 -0500 Subject: [PATCH 8/8] added benchmarks --- README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 03d45ad..ca11908 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,33 @@ Note: If you Run into an msvc error, please install MSCV from [here](https://lea ## 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 haven't uploaded the benchmarks yet, but I was able to scan through 120GB of files (Videos, PDFs, Images) in ~300ms. +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: + +``` +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