Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.0.0 #13

Merged
merged 16 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file.

## \[3.0.0]

### 🚀 Features - Breaking Changes
- `--ignore` can now skip files/directories with a specific name, instead of just paths.
- Breaking change, semantics are not the same as previous version, though it shouldn't affect much.
- Addresses [#12](https://github.com/LyonSyonII/hunt-rs/issues/12).
-
### 🐛 Bug Fixes
- `--ignore` now has the exact same behaviour regardless of the `--canonicalize` flag.

## \[2.4.0]

### 🚀 Features
Expand Down
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ repository = "https://github.com/LyonSyonII/hunt-rs"
keywords = ["algorithms", "filesystem"]
readme = "README.md"
license = "MIT"
version = "2.4.0"
version = "3.0.0"
authors = ["Liam G <liam.garriga@tutanota.com>"]
edition = "2021"
rust-version = "1.74.1"

[package.metadata.wix]
upgrade-guid = "93301563-2D91-4224-B838-C60D235011A0"
Expand All @@ -17,13 +18,13 @@ license = false
eula = false

[dependencies]
clap = { version = "4.5.2", features = ["derive", "color"] } # Command line argument parser
clap = { version = "4.5.20", features = ["derive", "color"] } # Command line argument parser
colored = "2.1.0" # Colored output
rayon = "1.9.0" # Parallelism library
crossbeam-channel = "0.5.12" # Faster channels (mpmc)
mimalloc = { version = "0.1.39", default-features = false } # Faster allocator
rayon = "1.10.0" # Parallelism library
crossbeam-channel = "0.5.13" # Faster channels (mpmc)
mimalloc = { version = "0.1.43", default-features = false } # Faster allocator
thin_str = "0.1.0" # Thinner string (only 8 bytes)
memchr = { version = "2.7.1", features = ["std", "alloc"] } # Small substring search optimization
memchr = { version = "2.7.4", features = ["std", "alloc"] } # Small substring search optimization
inquire = { version = "0.7.5" } # Multiselect CLI interface

# Multithreaded fine-grained profiler
Expand All @@ -33,10 +34,10 @@ features = ["rayon", "attributes"]
default-features = false

[target.'cfg(target_os = "linux")'.dependencies]
rustix = { version = "0.38.31", default-features = false, features = ["fs", "alloc"] }
rustix = { version = "0.38.34", default-features = false, features = ["fs", "alloc"] }

[target.'cfg(windows)'.dependencies]
winapi-util = "0.1.6"
winapi-util = "0.1.8"

[profile.release]
lto = true
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ Seeing how `find` did not perform any parallelism at all, I decided to make a mu
Hunt is multithreaded, so it's a lot faster than `find`, and more reliable than `locate` (recent files cannot be found with it).

## Installation
[![Packaging status](https://repology.org/badge/vertical-allrepos/hunt-find.svg)](https://repology.org/project/hunt-find/versions)
### Precompiled binaries
Download the latest binary from [releases](https://github.com/lyonsyonii/hunt-rs/releases).

Expand Down
108 changes: 88 additions & 20 deletions benchmarks/run
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,123 @@ cmd profile() {
}

sub bench {
const build = cargo build --release
const hunt = ../target/release/hunt
const fd = fd --unrestricted --color=never
const build = "cp ../target/release/hunt ./hunt-prev; cargo build --release"
const hunt = "../target/release/hunt"
const prev = "./hunt-prev" // previous hunt version
const 2_3 = "./hunt-2.3.0"
const fd = "fd --unrestricted --color=never"

cmd all() {
run bench 1;
run bench 2;
run bench 3;
run bench 4;
run bench 5;
run bench 6;
}

/// Search one file in ~/
cmd 1() {
$build;
HUNT="$hunt --hidden --first --exact SomeFile $HOME";
CMD="--hidden --first --exact SomeFile $HOME"
HUNT="$hunt $CMD";
HUNT_PREV="$prev $CMD";
HUNT2_3="$2_3 $CMD";
FD="$fd --max-results=1 SomeFile $HOME";
# FIND="find $HOME -name SomeFile -print -quit";
hyperfine -N --warmup 100 --ignore-failure \
"$FD" \
FIND="find $HOME -name SomeFile -print -quit";

hyperfine -N --warmup 1 --ignore-failure \
"$HUNT" \
# "$FIND"
"$HUNT2_3" \
"$FD" \
"$FIND";
# "$HUNT_PREV" \
}

/// Search multiple files in ~/
cmd 2() {
$build;
HUNT="hunt --hidden SomeFile $HOME";
HUNT2="$hunt --hidden SomeFile $HOME";
CMD="--hidden SomeFile $HOME";
HUNT="$hunt $CMD";
HUNT2_3="$2_3 $CMD";
HUNT_PREV="$prev $CMD";
FD="$fd SomeFile $HOME";
# FIND="find $HOME -name SomeFile -print";
FIND="find $HOME -name SomeFile -print";

hyperfine -N --warmup 1 --ignore-failure \
"$FD" \
"$HUNT" \
"$HUNT2"
# "$FIND"
"$HUNT2_3" \
"$FD" \
"$FIND" \
# "$HUNT_PREV" \
}

/// Search multiple files in /
cmd 3() {
$build;
HUNT="hunt --hidden SomeFile /";
HUNT2="$hunt --hidden SomeFile /";
CMD="--hidden SomeFile /";
HUNT="$hunt $CMD";
HUNT2_3="$2_3 $CMD";
HUNT_PREV="$prev $CMD";
FD="$fd SomeFile /";

hyperfine -N --warmup 1 --ignore-failure \
"$FD" \
"$HUNT" \
"$HUNT2"
"$HUNT2_3" \
"$FD" \
# "$HUNT_PREV" \
}

/// Search all files in ~/
cmd 4() {
$build;
HUNT="$hunt --hidden -ss $HOME";
FD="$fd . $HOME";
CMD="--hidden -ss $HOME";
HUNT="$hunt $CMD";
HUNT2_3="$2_3 $CMD";
HUNT_PREV="$prev $CMD";

hyperfine -N --warmup 1 --ignore-failure \
"$HUNT" \
"$HUNT2_3" \
"$FD" \
"$HUNT"
# "$HUNT_PREV" \
}

/// Different task depths
cmd 5() {
$build;
D="HUNT_MAX_DEPTH"
HUNT="$hunt --hidden --ends .nix flake $HOME"

hyperfine --warmup 1 --ignore-failure \
"$D=0 $HUNT" \
"$D=1 $HUNT" \
"$D=10 $HUNT" \
"$D=100 $HUNT" \
"$D=200 $HUNT" \
"$D=300 $HUNT" \
"$D=400 $HUNT" \
"$D=500 $HUNT" \
"$D=1000 $HUNT" \
"$D=2000 $HUNT"
}

/// Startup time (empty directory)
cmd 6() {
$build;
mkdir empty;
HUNT="$hunt";
HUNT2_3="$2_3";
FD="fd";
FIND="find $HOME -name SomeFile -print";

hyperfine -N --ignore-failure \
"$HUNT empty" \
"$HUNT2_3 empty" \
"$FD empty" \
"$FIND empty";

rmdir empty;
}
}
31 changes: 16 additions & 15 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading