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
- Allocation
Hotspot - Allocation hotspot
- Bottleneck
Analysis - Bottleneck analysis result
- Cache
Inefficiency - Cache inefficiency
- Cache
Stats - Cache statistics
- Detailed
Profile Result - Detailed profile result with breakdown
- Execution
Timeline - Execution timeline
- Hotspot
- Performance hotspot
- Memory
Bottleneck - Memory bottleneck
- Memory
Profile - Memory profiling result
- Memory
Snapshot - Memory snapshot
- Memory
Usage - Memory usage statistics
- Optimization
Hint - Optimization hint
- Performance
Profiler - Main performance profiler for ML algorithms
- Profile
Metrics - Performance metrics collected during profiling
- Profile
Result - Profile result with metrics and analysis
- Profiler
Config - Profiler configuration
- Profiler
Context - Context for detailed profiling with manual instrumentation
- Slow
Function - Slow function identification
Enums§
- Improvement
Estimate - Improvement estimate
- Optimization
Category - Optimization category
- Priority
- Priority level
- Severity
- Severity level