ProfileUtil

The class ProfileUtil can be used for performance profiling of the PythonParts source code

class ProfileUtil.ProfilerType(value)

Definition of profiler types

C_PROFILE = 1
LINE_PROFILER = 3
PY_INSTRUMENT = 2
__module__ = 'ProfileUtil'
class ProfileUtil.ProfileUtil

Profiler utility class

static profile(function: ~typing.Callable,
        *param:
~typing.Any
,
        calls_to_print=20
,
        description=''
,
        show_graphical_results=False
,
        profiler_type=ProfilerType.C_PROFILE
,
        show_separator_line=False
)

profile by cprofile

Parameters
  • function – function to execute

  • param – parameter for the function

  • calls_to_print – number of calls shown in the profile report (only for C_Profile)

  • description – description of the text

  • show_graphical_results – show graphical results (only for C_Profile)

  • profiler_type – type of the profiler

  • show_separator_line – show a separator line before the results

Returns

return value of the call function

__module__ = 'ProfileUtil'