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: A few of these monitors are only available in debug mode and will always return 0 when used in a release build.

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

Inheritance Chain

Static Properties

    public static Object Singleton { get; }

Static Methods

    public static float GetMonitor(Monitor monitor)

Returns the value of one of the available monitors. You should provide one of the Monitor 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 Number of frames per second.
TimeProcess 1 Time it took to complete one frame, in seconds.
TimePhysicsProcess 2 Time it took to complete one physics frame, in seconds.
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 in the scene tree. This also includes the root node.
ObjectOrphanNodeCount 11 Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree.
RenderObjectsInFrame 12 3D objects drawn per frame.
RenderVerticesInFrame 13 Vertices drawn per frame. 3D only.
RenderMaterialChangesInFrame 14 Material changes per frame. 3D only.
RenderShaderChangesInFrame 15 Shader changes per frame. 3D only.
RenderSurfaceChangesInFrame 16 Render surface changes per frame. 3D only.
RenderDrawCallsInFrame 17 Draw calls per frame. 3D only.
RenderVideoMemUsed 18 The amount of video memory used, i.e. texture and vertex memory combined.
RenderTextureMemUsed 19 The amount of texture memory used.
RenderVertexMemUsed 20 The amount of vertex memory used.
RenderUsageVideoMemTotal 21 Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0.
Physics2dActiveObjects 22 Number of active [RigidBody2D] nodes in the game.
Physics2dCollisionPairs 23 Number of collision pairs in the 2D physics engine.
Physics2dIslandCount 24 Number of islands in the 2D physics engine.
Physics3dActiveObjects 25 Number of active [RigidBody] and [VehicleBody] nodes in the game.
Physics3dCollisionPairs 26 Number of collision pairs in the 3D physics engine.
Physics3dIslandCount 27 Number of islands in the 3D physics engine.
AudioOutputLatency 28 Output latency of the [AudioServer].
MonitorMax 29 Represents the size of the [enum Monitor] enum.
Tags: