jdxi_editor.utils.profiling_decorator

Profiling decorator

Attributes

P

R

_log

Functions

profiling_decorator(→ Callable[[Callable[P, R]], ...)

Decorator to profile a function and log its performance.

Module Contents

jdxi_editor.utils.profiling_decorator.P[source]
jdxi_editor.utils.profiling_decorator.R[source]
jdxi_editor.utils.profiling_decorator._log[source]
jdxi_editor.utils.profiling_decorator.profiling_decorator(sortby: str = 'cumtime', top_n: int = 50) Callable[[Callable[P, R]], Callable[P, R]][source]

Decorator to profile a function and log its performance.

Output is written to the module logger and to stdout (flushed) so it appears in log files and in the terminal when the function returns (e.g. after closing the app when used on main()).

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

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