pub struct CompilationProfiler { /* private fields */ }Expand description
Main compilation profiler.
Implementations§
Source§impl CompilationProfiler
impl CompilationProfiler
Sourcepub fn with_config(config: ProfileConfig) -> Self
pub fn with_config(config: ProfileConfig) -> Self
Create a new profiler with custom configuration.
Sourcepub fn start_phase(&mut self, name: &str)
pub fn start_phase(&mut self, name: &str)
Start profiling a compilation phase.
Sourcepub fn record_pass(
&mut self,
pass_name: &str,
duration: Duration,
optimizations: usize,
)
pub fn record_pass( &mut self, pass_name: &str, duration: Duration, optimizations: usize, )
Record a pass execution.
Sourcepub fn snapshot_memory(&mut self)
pub fn snapshot_memory(&mut self)
Take a memory snapshot.
Sourcepub fn record_cache_lookup(&mut self, hit: bool)
pub fn record_cache_lookup(&mut self, hit: bool)
Record a cache lookup.
Sourcepub fn total_time(&self) -> Option<Duration>
pub fn total_time(&self) -> Option<Duration>
Get total compilation time.
Sourcepub fn peak_memory(&self) -> usize
pub fn peak_memory(&self) -> usize
Get peak memory usage.
Sourcepub fn slowest_phase(&self) -> Option<&PhaseTime>
pub fn slowest_phase(&self) -> Option<&PhaseTime>
Get the slowest compilation phase.
Sourcepub fn most_expensive_pass(&self) -> Option<&PassProfile>
pub fn most_expensive_pass(&self) -> Option<&PassProfile>
Get the most expensive pass (by total time).
Sourcepub fn generate_report(&self) -> String
pub fn generate_report(&self) -> String
Generate a human-readable profiling report.
Sourcepub fn generate_json_report(&self) -> String
pub fn generate_json_report(&self) -> String
Generate JSON profiling report.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompilationProfiler
impl RefUnwindSafe for CompilationProfiler
impl Send for CompilationProfiler
impl Sync for CompilationProfiler
impl Unpin for CompilationProfiler
impl UnwindSafe for CompilationProfiler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more