Skip to main content

Crate leptos_shadcn_performance_audit

Crate leptos_shadcn_performance_audit 

Source
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 optimization
  • performance_monitoring: Real-time performance metrics collection
  • optimization_roadmap: Smart recommendation generation
  • benchmarks: 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§

PerformanceConfig
Performance audit configuration
PerformanceResults
Performance audit results

Enums§

PerformanceAuditError
Performance audit error types

Functions§

run_performance_audit
Run comprehensive performance audit