Overview
Refactron includes several performance optimization features designed to handle large codebases efficiently:- AST Caching - Avoid re-parsing unchanged files
- Incremental Analysis - Only analyze changed files
- Parallel Processing - Analyze multiple files concurrently
Quick Start
Enable all optimizations in.refactron.yaml:
.refactron.yaml
AST Caching
Cache parsed Abstract Syntax Trees to avoid re-parsing.Benefits
Benefits
- 5-10x faster on repeated analysis
- Reduces CPU usage
- Especially effective for large files
Configuration
Configuration
Cache Statistics
Cache Statistics
Incremental Analysis
Only analyze files that changed since the last run. Benefits:- Up to 90% reduction in analysis time
- Ideal for CI/CD pipelines
- Perfect for iterative development
Parallel Processing
Analyze multiple files concurrently using multiprocessing. Configuration:.refactron.yaml
- ✅ Large codebases (1000+ files)
- ✅ Multi-core systems
- ❌ Small codebases (<10 files)
Best Practices by Project Size
Small Projects (<1000 files)
Medium Projects (1000-10000 files)
Large Projects (10000+ files)
Performance Statistics
Get detailed performance stats:Troubleshooting
Performance Not Improving
Performance Not Improving
Check if optimizations are enabled:
High Memory Usage
High Memory Usage
- Reduce cache size:
max_ast_cache_size_mb: 50 - Lower parallel workers:
max_parallel_workers: 2 - Clear caches periodically:
refactron.clear_caches()
Parallel Processing Slower
Parallel Processing Slower
Disable for small codebases:
Next Steps
Monitoring Guide
Learn how to monitor Refactron in production
