Skip to main content

Module profiling

Module profiling 

Source
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:

§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§

CompilationProfiler
A profiler that tracks compilation phases in real-time.
ProfileEntry
A single profiling entry for a compilation phase.
ProfileReport
A complete profiling report for a compilation run.

Functions§

profile_phase
Profile a closure as a single phase and return (result, entry).