Expand description
Compilation profiling and performance tracking.
This module provides tools for profiling the compilation process, tracking performance metrics, and identifying bottlenecks.
§Overview
Compilation profiling helps developers:
- Identify slow compilation passes
- Track memory usage during compilation
- Optimize compilation performance
- Compare different compilation strategies
§Features
- Time Tracking: Measure time spent in each compilation phase
- Memory Tracking: Monitor memory allocations and peak usage
- Pass Analysis: Identify expensive optimization passes
- Cache Statistics: Track cache hit rates and effectiveness
§Examples
use tensorlogic_compiler::profiling::{CompilationProfiler, ProfileConfig};
use tensorlogic_compiler::compile_to_einsum;
use tensorlogic_ir::{TLExpr, Term};
let mut profiler = CompilationProfiler::new();
profiler.start_phase("compilation");
let expr = TLExpr::pred("p", vec![Term::var("x")]);
let _graph = compile_to_einsum(&expr).unwrap();
profiler.end_phase("compilation");
let report = profiler.generate_report();
println!("{}", report);Structs§
- Cache
Stats - Cache statistics.
- Compilation
Profiler - Main compilation profiler.
- Memory
Snapshot - Memory usage snapshot.
- Pass
Profile - Pass-level profiling information.
- Phase
Time - Time spent in a compilation phase.
- Profile
Config - Configuration for compilation profiling.