LavaUI docs

enum EditorProbe

Swift

enum EditorProbe

Where an editor's time goes on a large buffer, opt-in via LAVA_EDITOR_PROBE=1.

WidgetProfiler answers "which widget is slow" at whole-paint granularity, and stops exactly where a large-file editor question starts: when the answer is "the editor", the next question is which of its passes, and the one after that is whether the cost tracks the buffer or the caret's position in it. Nearly every expensive thing here is a String.Index walk — offset(of:) and index(atOffset:) are O(distance from the buffer's start) — so a probe that reports only milliseconds hides the shape of the problem. Each sample therefore carries the offset it was working at, and a cost that grows as that number grows is a walk, not a workload.

Off, this is a Bool check per span. On, it prints a rolling summary to stderr about once a second, so a drag or a scroll can be watched live rather than reconstructed from a trace afterwards.

Sources/LavaUI/EditorProbe.swift:19

Properties

static let isEnabled: Bool

Not documented.

Sources/LavaUI/EditorProbe.swift:20

Methods

static func snapshot() -> [Sample]

Worst first, which is the order the answer is usually in.

Sources/LavaUI/EditorProbe.swift:114

Types