module

Egui::Bench

Class methods

aggregates
Source
collecting?
Source
count(key : String) : Nil

Free-form monotonic counter ("fonts.layout.hit" etc.) — volume facts that explain the span numbers.

Source
counters
Source
reset
Source
run(app : Egui::App, width : Float64 = 1920.0, height : Float64 = 1080.0, warmup : Int32 = 5, frames : Int32 = 20, mouse : Bool = true, print : Bool = true) : Report

Drive app headless: warmup frames (caches fill — Svg bakes, glyph atlas fills), then frames measured ones, running scenario before each frame so it can move the app into the state under test (mouse moves, router navigation, direct state pokes through driver.app). With mouse: true (default) each frame also gets a pointer move at the screen center — the "idle but the cursor moves" worst case for repaint-heavy apps.

The app's Context is prepared for realistic headless measuring: the font backend the caller installed stays (put a real one there for realistic measure() costs), and the texture registry becomes a graphical dummy so Svg icons take their production code path. pixels_per_point stays whatever the ctx has (1.0 unless set).

Blockless convenience overload: the default injected mouse move (the "cursor moves, nothing else happens" scenario) is all the frame needs.

Source
run(app : Egui::App, width : Float64 = 1920.0, height : Float64 = 1080.0, warmup : Int32 = 5, frames : Int32 = 20, mouse : Bool = true, print : Bool = true, &scenario : FrameDriver -> ) : Report

Returns the Report (also printed to STDOUT unless print: false).

Source
span(name : String, &)

Time the block under name while a bench runs; passes the block's value through (the guard may wrap value-producing calls, e.g. Context#end_frame's command flatten). Overhead when not collecting: one class-var read + an inlined yield.

Source

Nested types