Expand description
Compilation profiling: track time and resource usage across phases.
Instruments the compilation pipeline to provide per-phase timing breakdowns, helping identify bottlenecks and optimize compilation performance.
§Overview
The profiling module provides three main components:
ProfileEntry: A single profiling entry for a compilation phaseProfileReport: A complete profiling report for a compilation runCompilationProfiler: Real-time phase tracker for compilation
§Examples
use tensorlogic_compiler::profiling::{CompilationProfiler, ProfileReport, ProfileEntry};
let mut profiler = CompilationProfiler::new();
profiler.set_input_complexity(500);
profiler.begin_phase("parse");
profiler.set_items(120);
profiler.end_phase();
profiler.begin_phase("optimize");
profiler.set_items(80);
profiler.end_phase();
profiler.set_output_size(60);
let report = profiler.finish();
println!("{}", report.summary());Structs§
- Compilation
Profiler - A profiler that tracks compilation phases in real-time.
- Profile
Entry - A single profiling entry for a compilation phase.
- Profile
Report - A complete profiling report for a compilation run.
Functions§
- profile_
phase - Profile a closure as a single phase and return (result, entry).