Skip to content

Search documentation

Enter at least two characters.

    PerformanceStats

    SDK 0.1.0-preview.1 · ExperimentalDownload & release notes ↗

    A snapshot of runtime counters and the currently collected timing samples.

    Where to put it: replace Src/Main.luau in a project created with this SDK. This is the complete entry file.

    local Window = Instance.new("Window", {
    Title = "LUI example", Size = UDim2.fromOffset(560, 280),
    })
    local Status = Instance.new("TextLabel", {
    Parent = Window, Text = "Ready", Position = UDim2.fromOffset(16, 170),
    Size = UDim2.new(1, -32, 0, 72),
    })
    local Performance = app:GetService("PerformanceService")
    local Start = Performance:GetTime()
    task.delay(0.1, function()
    local Stats = Performance:GetStats()
    Status.Text = "Elapsed ms: " .. math.floor(Performance:GetTime() - Start)
    .. "; live Instances: " .. Stats.LiveInstances
    end)
    Window.Visible = true

    Expected result: Displays elapsed milliseconds and a runtime counter. The delay is scheduled work, not a precise real-time timer.

    Currently live Instances.

    Type: number. Read-only.

    Instances still retained by the runtime, which can include objects awaiting release.

    Type: number. Read-only.

    Currently retained signal connections.

    Type: number. Read-only.

    Memory attributed to the Luau VM, in bytes; this is not whole-process memory.

    Type: number. Read-only.

    Number of events waiting for delivery.

    Type: number. Read-only.

    Bytes charged to queued runtime data.

    Type: number. Read-only.

    Accumulated shared layout passes.

    Type: number. Read-only.

    Accumulated native presentation submissions, not visible display frames.

    Type: number. Read-only.

    Number of layout timing samples collected.

    Type: number. Read-only.

    95th-percentile layout time in milliseconds: 95% of collected samples were at or below this value.

    Type: number. Read-only.

    Duration of the most recent measured layout pass in milliseconds.

    Type: number. Read-only.

    Whether this runtime runs without a native display backend.

    Type: boolean. Read-only.

    Number of measured input-response samples.

    Type: number. Read-only.

    95th-percentile measured input-response time in milliseconds, excluding physical input/display latency.

    Type: number. Read-only.

    99th-percentile measured input-response time in milliseconds.

    Type: number. Read-only.

    Number of measured native render-submission samples.

    Type: number. Read-only.

    95th-percentile native render-submission time in milliseconds; not physical scanout.

    Type: number. Read-only.

    99th-percentile native render-submission time in milliseconds.

    Type: number. Read-only.

    Full type declaration — for type checking and deeper reference

    The declaration is generated from the SDK. Self is supplied by a colon call; read means the field cannot be assigned. See how to read this reference.

    export type PerformanceStats = {
    read LiveInstances: number,
    read RetainedInstances: number,
    read Connections: number,
    read LuaMemoryBytes: number,
    read QueuedEvents: number,
    read QueuedBytes: number,
    read LayoutPasses: number,
    read PresentationCalls: number,
    read LayoutSamples: number,
    read LayoutP95Ms: number,
    read LastLayoutMs: number,
    read IsHeadless: boolean,
    read InputSamples: number,
    read InputP95Ms: number,
    read InputP99Ms: number,
    read RenderSamples: number,
    read RenderP95Ms: number,
    read RenderP99Ms: number,
    }

    See platform limits before relying on host-specific behavior. The framework design specification and reflection/type sources are deeper engineering references, not extra setup required to build an app.