Performance_mesurements
measure_performance(func:Callable)
Decorator:
that measures the execution time and memory usage of a function. It uses: - `time.perf_counter()` for high-resolution timing. - `tracemalloc` to track memory allocations during execution.Parameters:
func
(Callable): The function to be wrapped.
Returns:
Callable
: The wrapped function with performance tracking.Labels:
src_PyThon_Utils_Performance_Performance_mesurements_measure_performance
average_performance(runs:int)
Decorator:
factory that returns a decorator to measure average performance of a function over multiple runs. It reports: - Average execution time over all runs - Average peak memory usageParameters:
runs
(int): Number of times to run the function for averaging (default: 1000)
Returns:
Callable
: The performance-measuring decorator.Labels:
src_PyThon_Utils_Performance_Performance_mesurements_average_performance