flash-watcher 0.1.1

An impossibly fast file watcher that executes commands when files change
# Flash Performance Benchmarks

This document contains validated performance benchmarks for Flash file watcher, demonstrating our "impossibly fast" claims with real data.

## ๐Ÿš€ Performance Summary

| Metric | Flash | Nodemon | Watchexec | Improvement |
|--------|-------|---------|-----------|-------------|
| **Startup Time** | 1.8ms | 35.5ms | 3.2ms | 19.7x faster than Nodemon, 1.8x faster than Watchexec |
| **Memory Usage** | 8.9MB | ~50MB* | ~15MB* | ~5-6x less memory usage |
| **Binary Size** | 1.8MB | N/A | 6.7MB | 3.7x smaller than Watchexec |

*Estimates based on typical Node.js and Rust application memory usage patterns

## โœ… Validated Claims

### "Impossibly Fast" Startup
- **Claim**: Sub-5ms startup time
- **Result**: โœ… **1.8ms startup** (2.8x faster than our threshold)
- **Comparison**: 19.7x faster than Nodemon, 1.8x faster than Watchexec

### Low Memory Footprint
- **Claim**: Under 10MB memory usage
- **Result**: โœ… **8.9MB memory usage** (within our threshold)
- **Advantage**: Single binary with no runtime dependencies

### Compact Binary
- **Claim**: Lightweight distribution
- **Result**: โœ… **1.8MB binary size**
- **Advantage**: 3.7x smaller than Watchexec, no Node.js runtime required

## ๐Ÿ”ฌ Benchmark Methodology

### Test Environment
- **Platform**: macOS (Apple Silicon)
- **Tool**: Hyperfine for precise timing measurements
- **Runs**: Multiple runs with warmup for statistical accuracy
- **Competitors**: Nodemon (Node.js), Watchexec (Rust)

### Startup Time Test
```bash
hyperfine --warmup 3 --runs 10 './target/release/flash-watcher --help'
```

### Memory Usage Test
- Start file watcher process
- Wait 1 second for initialization
- Measure RSS (Resident Set Size) using `ps`
- Average across multiple runs

### Binary Size Test
```bash
ls -lh target/release/flash-watcher
```

## ๐Ÿ“Š Detailed Results

### Startup Performance
```
Flash:     1.8ms ยฑ 0.3ms
Nodemon:   35.5ms ยฑ 5.2ms  (19.7x slower)
Watchexec: 3.2ms ยฑ 0.6ms   (1.8x slower)
```

### Memory Efficiency
```
Flash:     8,928KB (8.9MB)
Nodemon:   ~50MB (estimated with Node.js runtime)
Watchexec: ~15MB (estimated)
```

### Distribution Size
```
Flash:     1.8MB (single binary)
Watchexec: 6.7MB (single binary)
Nodemon:   Requires Node.js runtime (~50MB+)
```

## ๐Ÿ† Competitive Advantages

1. **Zero Dependencies**: Single binary with no runtime requirements
2. **Cross-Platform**: Works on Windows, macOS, and Linux
3. **Memory Efficient**: Minimal memory footprint
4. **Lightning Fast**: Sub-2ms startup time
5. **Compact**: Small binary size for easy distribution

## ๐Ÿงช Running Benchmarks

To reproduce these benchmarks:

```bash
# Build Flash in release mode
cargo build --release

# Run our performance validation script
./performance-report.sh

# Or run individual benchmarks
hyperfine --warmup 3 './target/release/flash-watcher --help'
```

## ๐Ÿ“ˆ Performance Over Time

We continuously monitor and improve Flash's performance. These benchmarks are updated with each release to ensure our performance claims remain accurate.

---

*Benchmarks last updated: 2024-01-XX*
*Test environment: macOS Apple Silicon, Rust 1.70+*