Module performance_profiling

Module performance_profiling 

Source
Expand description

§Advanced Performance Profiling and Optimization Framework

This module provides comprehensive performance profiling, analysis, and optimization capabilities for machine learning algorithms. It enables detailed performance measurement, bottleneck identification, and automated optimization suggestions.

§Key Features

  • Micro-Benchmarking: Fine-grained performance measurement
  • Hotspot Detection: Identify performance bottlenecks
  • Memory Profiling: Track memory allocations and usage patterns
  • Cache Analysis: Measure cache hit rates and memory access patterns
  • SIMD Utilization: Analyze vectorization opportunities
  • Flamegraph Generation: Visualize execution profiles
  • Optimization Recommendations: Automated suggestions for improvements
  • Cross-Platform Profiling: Consistent profiling across targets

§Usage

use sklears_core::performance_profiling::*;

// Profile an algorithm
let profiler = PerformanceProfiler::new();
let profile = profiler.profile(|| {
    // Your ML algorithm here
    train_model(&data);
})?;

// Analyze bottlenecks
let analysis = profile.analyze_bottlenecks()?;
for bottleneck in &analysis.hotspots {
    println!("Hotspot: {} ({:.2}% of total time)",
             bottleneck.location,
             bottleneck.time_percentage);
}

// Get optimization recommendations
let recommendations = profile.get_optimization_recommendations()?;

Structs§

Allocation
Memory allocation record
AllocationHotspot
Allocation hotspot
BottleneckAnalysis
Bottleneck analysis result
CacheInefficiency
Cache inefficiency
CacheStats
Cache statistics
DetailedProfileResult
Detailed profile result with breakdown
ExecutionTimeline
Execution timeline
Hotspot
Performance hotspot
MemoryBottleneck
Memory bottleneck
MemoryProfile
Memory profiling result
MemorySnapshot
Memory snapshot
MemoryUsage
Memory usage statistics
OptimizationHint
Optimization hint
PerformanceProfiler
Main performance profiler for ML algorithms
ProfileMetrics
Performance metrics collected during profiling
ProfileResult
Profile result with metrics and analysis
ProfilerConfig
Profiler configuration
ProfilerContext
Context for detailed profiling with manual instrumentation
SlowFunction
Slow function identification

Enums§

ImprovementEstimate
Improvement estimate
OptimizationCategory
Optimization category
Priority
Priority level
Severity
Severity level