Features: 1. scan command - Fast import without hash (skip_hash=true) - Scans directory structure - Generates deterministic UUIDs (SHA256(path|name|mac|mtime)) - Stores full path in aliases.json - Inserts nodes in batches - Performance: 14243 nodes/sec (11857 files in 0.89s) 2. hash command - Async hash calculation - Multi-threaded (default: 4 threads) - Reads paths from aliases.json - Updates database with SHA256 hashes - Performance: 28 files/sec (11857 files in 417.58s) Design: - Import first, hash later (user can view tree immediately) - Hash runs in background (non-blocking) - Path stored in aliases.json (temporary solution) - Deterministic UUIDs (same file = same UUID) Performance breakdown: - Scanning: 0.10s (11%) - ID generation: 0.57s (64%) - DB insertion: 0.21s (24%) - Hash: 417.58s (async, background) Files: - src/scan.rs (new, 499 lines) - src/main.rs (scan/hash commands) - src/lib.rs (scan module) Test result: - warren user: 12658 nodes imported - 11857 hashes calculated successfully
5.8 MiB
5.8 MiB