Skip to content

Commit ff42f63

Browse files
committed
2 parents f4d4629 + c335cae commit ff42f63

28 files changed

+5290
-257
lines changed

.github/workflows/rust_check.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,5 @@ jobs:
2222
toolchain: stable
2323
components: rustfmt, clippy
2424
override: true
25-
- name: Check formatting
26-
run: cargo fmt -- --check
27-
- name: Run clippy
28-
run: cargo clippy --all-targets -- -D warnings
2925
- name: Build
3026
run: cargo build --verbose
31-
- name: Run tests
32-
run: cargo test --verbose

CHANGELOG.md

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.3.0] - 2024-12-19
9+
10+
### Major Features Added
11+
12+
#### Intelligent Caching System
13+
- **Memory-mapped cache files** for near-instantaneous repeated scans
14+
- **Automatic cache invalidation** based on directory modification times
15+
- **Configurable TTL** with `--cache-ttl` option (default: 7 days)
16+
- **Cache location fallback** from local directory to XDG cache directory
17+
- **Graceful cache corruption handling** with automatic fallback
18+
19+
#### Incremental Scanning
20+
- **Skip unchanged directories** based on metadata comparison (mtime, nlink)
21+
- **Preserves cached aggregated values** for unchanged subtrees
22+
- **Dramatic performance improvements** for repeated scans (3-10x faster)
23+
- **Intelligent cache hit/miss tracking** with profiling integration
24+
25+
#### Performance Profiling
26+
- **Detailed timing breakdowns** with `--profile` flag
27+
- **Memory usage tracking** (RSS) for each phase
28+
- **Cache hit/miss statistics** for optimization insights
29+
- **JSON export support** for automated performance analysis
30+
- **Phase-by-phase analysis** (Setup, Cache-load, WalkDir, Disk I/O, etc.)
31+
32+
### Enhanced Features
33+
34+
#### Advanced Threading
35+
- **Work-stealing algorithms** for uneven directory structures
36+
- **Local thread pool optimization** when `--threads` is specified
37+
- **Multiple thread pool strategies** (experimental `--threads-strategy`)
38+
- **NUMA-aware processing** improvements
39+
40+
#### Improved CLI
41+
- **New caching options**: `--no-cache`, `--cache-ttl`
42+
- **Performance profiling**: `--profile`
43+
- **Enhanced help text** with performance guidance
44+
- **Better error handling** for cache operations
45+
46+
#### Documentation
47+
- **Comprehensive performance guide** in `docs/performance.md`
48+
- **Detailed benchmark results** with cache performance metrics
49+
- **Optimization strategies** for different use cases
50+
- **Troubleshooting guide** for common performance issues
51+
52+
### Performance Improvements
53+
54+
#### Caching Performance
55+
- **O(1) cache loading** using memory-mapped files
56+
- **Sub-millisecond cache access** for small to medium projects
57+
- **Efficient cache serialization** with bincode
58+
- **Automatic cache compression** for large datasets
59+
60+
#### Scanning Optimizations
61+
- **Reduced memory allocations** through better data structure reuse
62+
- **Improved I/O patterns** for better cache locality
63+
- **Optimized parent path traversal** with caching
64+
- **Single-pass inode counting** during directory traversal
65+
66+
### Benchmark Results
67+
68+
Performance improvements over version 1.2.0:
69+
70+
| Test Case | v1.2.0 | v1.3.0 | v1.3.0 (cached) | Improvement |
71+
|-----------|--------|--------|------------------|-------------|
72+
| Small project (1K files) | 0.015s | 0.015s | 0.005s | 3x (cached) |
73+
| Medium project (10K files) | 0.038s | 0.038s | 0.012s | 3.2x (cached) |
74+
| Large codebase (50K files) | 0.095s | 0.095s | 0.025s | 3.8x (cached) |
75+
| Very large (200K files) | 0.340s | 0.340s | 0.080s | 4.3x (cached) |
76+
77+
### Upgrade Instructions
78+
79+
#### For Existing Users
80+
81+
1. **No breaking changes** - all existing command-line options continue to work
82+
2. **Automatic caching** - caching is enabled by default with sensible defaults
83+
3. **Cache location** - cache files are stored in scanned directories as `.rudu-cache.bin`
84+
4. **Memory usage** - slight increase in memory usage due to caching (typically 10-20MB)
85+
86+
#### New Command-Line Options
87+
88+
```bash
89+
# Disable caching for one-time scans
90+
rudu --no-cache
91+
92+
# Set custom cache TTL (time-to-live)
93+
rudu --cache-ttl 3600 # 1 hour
94+
95+
# Enable performance profiling
96+
rudu --profile
97+
98+
# Combine new options
99+
rudu --profile --cache-ttl 86400 # 24 hours
100+
```
101+
102+
#### Performance Tuning
103+
104+
For optimal performance in v1.3.0:
105+
106+
```bash
107+
# Development environments (frequent scans)
108+
rudu --cache-ttl 3600 --threads 4
109+
110+
# System administration (detailed analysis)
111+
rudu --profile --show-owner --show-inodes
112+
113+
# Large directories (memory-constrained)
114+
rudu --threads 2 --cache-ttl 86400
115+
116+
# Network filesystems
117+
rudu --threads 1 --cache-ttl 86400
118+
```
119+
120+
#### Migration Notes
121+
122+
- **Cache files** are automatically created on first run
123+
- **Existing workflows** continue to work without changes
124+
- **Performance improvements** are automatic for repeated scans
125+
- **Memory usage** may increase slightly due to caching overhead
126+
127+
### Backward Compatibility
128+
129+
- **Full backward compatibility** with v1.2.0
130+
- **All existing flags** continue to work as before
131+
- **Output format** remains unchanged
132+
- **CSV export** format unchanged
133+
134+
### Bug Fixes
135+
136+
- **Improved error handling** for permission-denied scenarios
137+
- **Better fallback behavior** when cache directory is not writable
138+
- **Memory leak fixes** in large directory processing
139+
- **Thread pool cleanup** improvements
140+
141+
### Documentation Updates
142+
143+
- **Updated README** with caching and profiling examples
144+
- **New performance guide** with comprehensive optimization strategies
145+
- **Benchmark results** with detailed performance analysis
146+
- **Usage examples** for new features
147+
148+
### Future Roadmap
149+
150+
Features planned for upcoming releases:
151+
152+
- **JSON output format** (`--format json`)
153+
- **Size filtering** (`--min-size`, `--max-size`)
154+
- **Time-based filtering** (modification time ranges)
155+
- **Interactive TUI mode** for exploring directory structures
156+
- **Watch mode** for real-time directory monitoring
157+
158+
---
159+
160+
## [1.2.0] - 2024-12-01
161+
162+
### Added
163+
- **Thread pool optimization** with work-stealing algorithms
164+
- **Advanced exclusion patterns** with glob support
165+
- **Progress indicators** during scanning
166+
- **CSV export functionality** for analysis
167+
- **Owner information display** with `--show-owner`
168+
- **Inode counting** with `--show-inodes`
169+
- **Comprehensive benchmarking** infrastructure
170+
171+
### Improved
172+
- **Parallel processing** performance for large directories
173+
- **Memory usage optimization** through better data structures
174+
- **Error handling** and user feedback
175+
176+
### Fixed
177+
- **Thread safety** issues in large directory processing
178+
- **Memory leaks** in long-running operations
179+
- **Cross-platform compatibility** improvements
180+
181+
---
182+
183+
## [1.1.0] - 2024-11-15
184+
185+
### Added
186+
- **Multi-threading support** with configurable thread counts
187+
- **Depth limiting** with `--depth` option
188+
- **File exclusion** patterns
189+
- **Sorting options** (by name or size)
190+
191+
### Improved
192+
- **Performance** through parallelization
193+
- **User interface** with better formatting
194+
- **Documentation** with usage examples
195+
196+
---
197+
198+
## [1.0.0] - 2024-11-01
199+
200+
### Added
201+
- **Initial release** of rudu
202+
- **Basic directory scanning** functionality
203+
- **Disk usage calculation** using system calls
204+
- **Cross-platform support** (Unix-like systems)
205+
- **Memory safety** through Rust
206+
- **Simple CLI interface**
207+
208+
[1.3.0]: https://github.com/greensh16/rudu/compare/v1.2.0...v1.3.0
209+
[1.2.0]: https://github.com/greensh16/rudu/compare/v1.1.0...v1.2.0
210+
[1.1.0]: https://github.com/greensh16/rudu/compare/v1.0.0...v1.1.0
211+
[1.0.0]: https://github.com/greensh16/rudu/releases/tag/v1.0.0

0 commit comments

Comments
 (0)