Log inGet started
World

Kit Speed Lab: Repeatable Benchmarks for Kits and Games

README.md

speedLab.cycles

The teardown memory check over several match cycles, for any benchmark set. Each cycle builds one benchmark's match (its own build), plays it, tears it down with the set's own teardown and reads memory again; every reading is compared with a baseline read before the first build. It answers whether anything a kit keeps after a match adds up from match to match.

What it compares: the Luau heap after the collector has finished a cycle (scripts cannot call a full collection, so it churns short-lived garbage and takes the lowest heap seen), process private memory, GPU device memory and textures, the entity count (with the names of what is left over), script component instances by type, and audio voices in use. It answers per cycle the change against the baseline and the slope in MB (or count) a minute over the after-teardown readings.

Run it in play, in a background task, with the set's module required first:

require("speedLabHoldfast.set")
local C = require("speedLab.cycles")
print(C.format(C.run({ set = "holdfast", benchmark = "holdfast.play", cycles = 4, matchSeconds = 45 })))

C.timed(opts) keeps one match running and samples memory every 10 s; C.soak(opts, fn) runs from edit mode the way Lab.run does (enters play, runs, throws the play changes away); C.probe() takes one reading; C.settledHeapMB(seconds) is the settled heap alone. In a browser (web) client a background call answers no one: enter play first and read the answers from C.results. Used by the Holdfast and Final Round soak results.