Frame Lab: Repeatable Performance Benchmarks and Game Charts
README.md
benchKit.capture
How much of a benchmark run is kept, from the summary numbers alone to every frame. Four levels, each adding to the one before:
- light: the summary numbers only (what benchKit 1.x gave). No engine recording.
- frames: every frame's time, engine CPU, wait for a core, GPU time, CPU by engine schedule and system, script time (component updates, tasks, the Luau GC step, named
profiler.beginblocks), entity/draw/instance counts, and hitches with the systems inside them. - memory: adds a memory sample every 100 ms (process, allocator, every engine memory source, GPU memory by kind, caches, each Luau VM's heap and allocations) and the leak check (memory after teardown against before the build, pass or fail).
- comprehensive: adds every GPU frame with each pass's time, the loading and shader-compile timeline (every worker job), and sampled Luau call stacks for flame graphs.
The recording is the engine's own profiler.startCapture, done in native code as each frame closes; benchKit only adds the camera-path marks and reads the recording back afterwards. Capture.collect turns it into a compact dataset (columns packed by benchKit.codec) and a summary (peaks, growth, GC pauses, allocation rate, recording cost against its limit, unavailable figures with reasons). Capture.memorySnapshot() reads memory at one moment; Capture.leakCheck(before, after) judges growth. Called by benchKit.runner; read back with Capture.unpack(data).