profiler

class janim.render.profiler.RenderProfiler(callback: Callable[[FrameRecord], Any])

Bases: object

Performance Profiler

Used to patch item rendering and collect timing and performance statistics

Parameters:

callback – Callback used to receive results, taking a FrameRecord argument

record_frame()

Use this function in a top-level rendering with block to measure the time spent on items in the inner code block and pass the result to the callback

class janim.render.profiler.FrameRecord(timestamp: float, elapsed: float, times: list[tuple[str, float]])

Bases: object

Timing statistics for each kind of item within a single frame

timestamp: float
elapsed: float
times: list[tuple[str, float]]