Exposes performance related data.
    public static class Performance

This class provides access to a number of different monitors related to performance, such as memory usage, draw calls, and FPS. These are the same as the values displayed in the Monitor tab in the editor’s Debugger panel. By using the GetMonitor(Godot.Performance.Monitor) method of this class, you can access this data from your code. Note that a few of these monitors are only available in debug mode and will always return 0 when used in a release build.

Many of these monitors are not updated in real-time, so there may be a short delay between changes.

Inheritance Chain

Static Methods

    public static float GetMonitor(Monitor monitor)

Returns the value of one of the available monitors. You should provide one of this class’s constants as the argument, like this:

[codeblock]

print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console

[/codeblock]

Inner Types

Monitor

Name Value Description
TimeFps 0 Frames per second.
TimeProcess 1 Time it took to complete one frame.
TimePhysicsProcess 2 Time it took to complete one physics frame.
MemoryStatic 3 Static memory currently used, in bytes. Not available in release builds.
MemoryDynamic 4 Dynamic memory currently used, in bytes. Not available in release builds.
MemoryStaticMax 5 Available static memory. Not available in release builds.
MemoryDynamicMax 6 Available dynamic memory. Not available in release builds.
MemoryMessageBufferMax 7 Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications.
ObjectCount 8 Number of objects currently instanced (including nodes).
ObjectResourceCount 9 Number of resources currently used.
ObjectNodeCount 10 Number of nodes currently instanced. This also includes the root node, as well as any nodes not in the scene tree.
RenderObjectsInFrame 11 3D objects drawn per frame.
RenderVerticesInFrame 12 Vertices drawn per frame. 3D only.
RenderMaterialChangesInFrame 13 Material changes per frame. 3D only
RenderShaderChangesInFrame 14 Shader changes per frame. 3D only.
RenderSurfaceChangesInFrame 15 Render surface changes per frame. 3D only.
RenderDrawCallsInFrame 16 Draw calls per frame. 3D only.
RenderVideoMemUsed 17 Video memory used. Includes both texture and vertex memory.
RenderTextureMemUsed 18 Texture memory used.
RenderVertexMemUsed 19 Vertex memory used.
RenderUsageVideoMemTotal 20  
Physics2dActiveObjects 21 Number of active [RigidBody2D] nodes in the game.
Physics2dCollisionPairs 22 Number of collision pairs in the 2D physics engine.
Physics2dIslandCount 23 Number of islands in the 2D physics engine.
Physics3dActiveObjects 24 Number of active [RigidBody] and [VehicleBody] nodes in the game.
Physics3dCollisionPairs 25 Number of collision pairs in the 3D physics engine.
Physics3dIslandCount 26 Number of islands in the 3D physics engine.
MonitorMax 27  
Tags: