Expand description
Performance Audit System for leptos-shadcn-ui
This module provides comprehensive performance testing and monitoring for the leptos-shadcn-ui component library using TDD principles.
§Features
- Bundle Size Analysis: Analyze component bundle sizes and identify optimization opportunities
- Performance Monitoring: Real-time monitoring of component render times and memory usage
- Optimization Roadmap: Generate actionable recommendations for performance improvements
- Benchmarking: Comprehensive benchmarking suite for performance regression testing
- CLI Tool: Command-line interface for running audits and generating reports
§Quick Start
use leptos_shadcn_performance_audit::{run_performance_audit, PerformanceConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = PerformanceConfig::default();
let results = run_performance_audit(config).await?;
println!("Overall Performance Score: {:.1}/100", results.overall_score);
println!("Grade: {}", results.get_grade());
Ok(())
}§CLI Usage
# Run complete performance audit
performance-audit audit
# Analyze bundle sizes only
performance-audit bundle --components-path packages/leptos
# Monitor performance in real-time
performance-audit monitor --duration 30s --sample-rate 100ms
# Generate optimization roadmap
performance-audit roadmap --output roadmap.json§Architecture
The system is built with a modular architecture:
bundle_analysis: Component bundle size analysis and optimizationperformance_monitoring: Real-time performance metrics collectionoptimization_roadmap: Smart recommendation generationbenchmarks: Performance regression testing
Each module is thoroughly tested using TDD principles to ensure reliability and maintainability.
Modules§
- benchmarks
- Performance Benchmarks Module
- bundle_
analysis - Bundle Size Analysis Module
- optimization_
roadmap - Optimization Roadmap Module
- performance_
monitoring - Performance Monitoring Module
Structs§
- Performance
Config - Performance audit configuration
- Performance
Results - Performance audit results
Enums§
- Performance
Audit Error - Performance audit error types
Functions§
- run_
performance_ audit - Run comprehensive performance audit