The --analyze parameter controls how folder-datetime-fix analyzes folder structures and computes timestamps. Different strategies offer trade-offs between memory usage, speed, and functionality.
# Auto-select based on path characteristics (default)
folder-datetime-fix /path --fix-all
# Force specific strategy
folder-datetime-fix /path --fix-all --analyze=tree
folder-datetime-fix /path --fix-all --analyze=low-memory
folder-datetime-fix /path --fix-all --analyze=folder-only
# Combine with modifiers
folder-datetime-fix /path --fix-all --analyze=standard,no-cache
folder-datetime-fix /path --fix-all --analyze=auto=2.0 # Double thresholdAutomatic strategy selection based on path characteristics
- Samples folder structure to estimate size
- Detects network vs local paths
- Calculates memory threshold based on system RAM (1% target)
- Selects optimal strategy automatically
When selected:
- Small local paths →
standardwith caching - Large local paths →
low-memorywithout caching - Network paths → Uses shallow scanning to reduce latency
Threshold calculation:
- 16GB RAM → ~470K folders threshold
- 32GB RAM → ~940K folders threshold
- 64GB RAM → ~1.9M folders threshold
Customization:
# Double the threshold (use more memory if needed)
--analyze=auto=2.0
# Half the threshold (more conservative)
--analyze=auto=0.5Streaming strategy with smart caching
- Processes folders as encountered
- Maintains cache for repeated lookups
- Supports shallow/deep/smart scanning modes
- Best for most use cases
Memory usage: ~350 bytes per cached folder
Scan modes (via --strategy):
shallow: Only immediate files (fast, may miss nested updates)deep: All files recursively (accurate but slower)smart: Adaptive based on folder structure (default)
Ultra-low memory mode for massive trees
- No caching (zero memory footprint for cache)
- Recomputes timestamps as needed
- Ideal for trees with millions of folders
- Slower but memory-safe
Memory usage: < 1MB regardless of tree size
Use when:
- Processing network shares with millions of folders
- System has limited available RAM
- One-time operations where speed isn't critical
Memory-efficient tree with bottom-up computation
- Builds complete folder hierarchy in memory
- Computes timestamps bottom-up (children before parents)
- Each folder computed exactly once
- Optimal for deep hierarchies
Memory usage: ~200 bytes per folder
Algorithm:
- Build tree structure (folders only)
- Compute leaf folders first
- Bubble up timestamps to parents
- Extract results for requested depths
Best for:
- Deep folder hierarchies
- When parent folders depend on child timestamps
- Multiple operations on same tree structure
Ultra-minimal memory mode with timestamp computation
- Computes timestamps without storing file objects
- Processes files on-the-fly for each folder
- Uses cache for efficiency
- Minimal memory footprint
Memory usage: ~100 bytes per folder
Use cases:
- Memory-constrained environments
- Large directory trees
- When timestamps are needed but memory is limited
- Efficient folder-only processing
┌─────────────────┐
│ User specifies │──Yes──→ Use specified strategy
│ --analyze? │
└────────┬────────┘
│ No
↓
┌─────────────────┐
│ Path is UNC/ │──Yes──→ Consider network optimizations
│ Network share? │
└────────┬────────┘
│ No
↓
┌─────────────────┐
│ Estimate folder │
│ count │
└────────┬────────┘
↓
┌─────────────────┐
│ Count > system │──Yes──→ Use low-memory strategy
│ threshold? │
└────────┬────────┘
│ No
↓
Use standard
with caching
| Strategy | Memory per 10K folders | Speed | Use Case |
|---|---|---|---|
| folder-only | ~1MB | Fastest | Ultra-minimal with timestamps |
| low-memory | <1MB | Slowest | Massive trees |
| tree | ~2MB | Fast | Deep hierarchies |
| standard | ~3.5MB | Fast | General use |
| auto | Varies | Varies | Automatic |
- Auto-strategy detects UNC paths
- Prefers
shallowscanning to reduce round-trips - Consider
--analyze=low-memoryfor massive shares - Network latency dominates over memory usage
- Can use more aggressive caching
smartscanning provides best accuracy- Tree strategy excels with deep hierarchies
- Memory usage is primary concern
- All strategies respect
--skip-generated - System folders filtered before processing
- No impact on strategy selection
The --analyze parameter works with --strategy:
# Tree mode with deep scanning
folder-datetime-fix /path --analyze=tree --strategy=deep
# Low memory with shallow scanning
folder-datetime-fix /path --analyze=low-memory --strategy=shallowDisable caching even in standard mode:
folder-datetime-fix /path --analyze=standard,no-cacheAdjust auto-strategy thresholds:
# Use 2% of RAM instead of 1%
folder-datetime-fix /path --analyze=auto=2.0
# Conservative - use 0.5% of RAM
folder-datetime-fix /path --analyze=auto=0.5If you encounter memory issues:
- Use
--analyze=low-memoryto force minimal memory usage - Use
--analyze=folder-onlyfor ultra-minimal memory with timestamps - Process smaller depth ranges separately
- Increase system swap/pagefile
If analysis is too slow:
- Use
--strategy=shallowfor faster scanning - Skip system files with
--skip-generated - Limit depth with specific depth values
- Consider
--analyze=treefor deep hierarchies
If timestamps seem wrong:
- Use
--strategy=deepfor complete accuracy - Check if system files are affecting results
- Verify file permissions allow reading
- Use
--verbose=2to see what's being scanned
# Analyze large network share
folder-datetime-fix \\server\share --fix-all --analyze=low-memory
# Local development folder with caching
folder-datetime-fix C:\projects --fix-all --analyze=standard
# Quick structure overview
folder-datetime-fix /path --depths=0,1,2 --analyze=folder-only
# Memory-constrained system
folder-datetime-fix /path --fix-all --analyze=auto=0.25
# Deep hierarchy optimization
folder-datetime-fix /path --fix-all --analyze=tree --strategy=smart- Run
folder-datetime-fix --help analyzefor quick reference - Run
folder-datetime-fix --help strategyfor scanning strategies - See Performance Guide for optimization tips
- See Memory Management for detailed analysis