picogl.ui.profiling_decorator

Functions

function_profiler([_func, sortby, top_n])

A decorator to profile function performance. Can be used with or without arguments.

function_profiler_old([sortby, top_n])

Decorator to profile a function and log its performance.

Module Contents

picogl.ui.profiling_decorator.function_profiler(_func: Callable | None = None, *, sortby: str = 'cumtime', top_n: int = 50)[source]

A decorator to profile function performance. Can be used with or without arguments.

Usage:

@function_profiler def my_func(): …

@function_profiler(sortby=’tottime’, top_n=25) def another_func(): …

Parameters:
  • _func – Internal placeholder for decorator usage without parameters.

  • sortby – str - Sorting key for profiling (‘cumtime’, ‘tottime’, etc).

  • top_n – int - Number of top functions to show in profile output.

picogl.ui.profiling_decorator.function_profiler_old(sortby='cumtime', top_n=50)[source]

Decorator to profile a function and log its performance.

Parameters:
  • sortby – str - Sorting criteria for profiling results (‘cumtime’ or ‘tottime’).

  • top_n – int - Number of top entries to display in the profiling results.