Profiler

MemoryProfiler

class golem.utilities.profiler.memory_profiler.MemoryProfiler(function, path: str, args=None, kwargs=None, roots=None, max_depth: int = 7, visualization=False)[source]

Bases: object

Visual interpretation of memory usage. Create two png files.

Parameters
  • function – function to profile.

  • path – path to save profiling result.

  • args (list) – arguments for function in array format.

  • kwargs (dict) – arguments for function in dictionary format.

  • roots (list) – array with classes used as ROOT nodes in the call-graph.

  • max_depth (int) – maximum depth of graph.

TimeProfiler

class golem.utilities.profiler.time_profiler.TimeProfiler[source]

Bases: object

Profile code and visual interpret results of it

_generate_pstats(path: str)[source]

Aggregate profiler statistics and create output.pstats from Profiler

Parameters

path – path to save results

profile(path: str, node_percent: float = 0.5, edge_percent: float = 0.1, open_web: bool = False)[source]

Method to convert the statistics from profiler to visual representation

Parameters
  • spath – path to save profiling result

  • node_percent – eliminate nodes below this threshold [default: 0.5]

  • edge_percent – eliminate edges below this threshold [default: 0.1]

  • open_web – boolean parametr to open web-interface