Skip to main content

Module profiling

Module profiling 

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

CacheStats
Cache statistics.
CompilationProfiler
Main compilation profiler.
MemorySnapshot
Memory usage snapshot.
PassProfile
Pass-level profiling information.
PhaseTime
Time spent in a compilation phase.
ProfileConfig
Configuration for compilation profiling.