haive.core.utils.debugkit.profiling.performance¶
Performance Profiling Utilities
Provides comprehensive performance analysis including line-by-line profiling, memory analysis, CPU profiling, and execution optimization insights.
Classes¶
CPU profiling utilities. |
|
Line-by-line performance profiler. |
|
Memory usage profiler. |
|
Comprehensive profiling utilities. |
|
Simple timing profiler for function execution. |
Module Contents¶
- class haive.core.utils.debugkit.profiling.performance.CPUProfiler[source]¶
CPU profiling utilities.
- profile_cpu(func, duration=10)[source]¶
Profile CPU usage with pyinstrument.
- Parameters:
func (collections.abc.Callable)
duration (int)
- Return type:
- class haive.core.utils.debugkit.profiling.performance.LineProfiler[source]¶
Line-by-line performance profiler.
- profile_lines(func)[source]¶
Profile function line by line.
- Parameters:
func (collections.abc.Callable)
- Return type:
- class haive.core.utils.debugkit.profiling.performance.MemoryProfiler[source]¶
Memory usage profiler.
- memory_line_by_line(func)[source]¶
Profile memory usage line by line using memory_profiler.
- Parameters:
func (collections.abc.Callable)
- Return type:
- profile_memory(func)[source]¶
Decorator to profile memory usage.
- Parameters:
func (collections.abc.Callable)
- Return type:
- class haive.core.utils.debugkit.profiling.performance.ProfilingUtilities[source]¶
Comprehensive profiling utilities.
- benchmark(func, iterations=1000, warmup=100)[source]¶
Benchmark a function with multiple iterations.
- comprehensive(func)[source]¶
Apply comprehensive profiling (time + memory + CPU).
- Parameters:
func (collections.abc.Callable)
- Return type:
- cpu(func=None)[source]¶
Profile CPU usage.
- Parameters:
func (collections.abc.Callable | None)
- Return type:
- line(func=None)[source]¶
Profile line-by-line execution.
- Parameters:
func (collections.abc.Callable | None)
- Return type:
- memory(func=None, line_by_line=False)[source]¶
Profile memory usage.
- Parameters:
func (collections.abc.Callable | None)
line_by_line (bool)
- Return type:
- profile_context(name='profile', include_memory=True, include_cpu=True)[source]¶
Context manager for profiling a block of code.
- time(func=None)[source]¶
Time function execution.
- Parameters:
func (collections.abc.Callable | None)
- Return type:
- class haive.core.utils.debugkit.profiling.performance.TimingProfiler[source]¶
Simple timing profiler for function execution.
- time_function(func)[source]¶
Decorator to time function execution.
- Parameters:
func (collections.abc.Callable)
- Return type: