pesde goatsoft / lucy

Benchmarks

How long Lucy takes to build UI, update it and tear it down, measured in Studio. The suites live in tests/Bench and anyone can run them.

Results

Lucy main (unreleased, November 2026) in Roblox Studio 0.747 (edit mode), on an Apple M1 Max: 30 timed iterations after 5 warmups, the median of five such runs. Times are per run of the benchmark, not per item. Store suites repeat their operation 100 times per run.

BenchmarkGroupSizeMedian (ms)p95 (ms)Heap (KB)
Mount a keyed listLists1,00015.1421.142176
Edit 100 rows, one write eachLists1,0000.480.600
Reverse a keyed listLists1,0006.257.44158
Append 100 rowsLists1,0003.063.70493
Clear a keyed listLists1,0006.327.440
Destroy a mounted listLists1,0005.847.300
HUD frame: 50 values, 200 labelsHUD2000.360.480
One value, 1,000 readersHUD1,0001.972.350
Mount ButtonsComponents1004.926.26784
Mount SwitchesComponents10015.8618.741515
Toggle SwitchesComponents1000.760.9417
Set Button textComponents1000.360.460
Set Button disabledComponents1000.630.770
Set Button variantComponents1000.550.710
Write one component, 10 mountedStore100.080.090
Write one component, 1,000 mountedStore1,0000.080.090
Subscribe 1,000 paths, write oneStore1,0000.120.150
Read a table of 1,000 keys after one writeStore1,0002.2931.573205
Set a table equal to the stored oneStore1,0002.832.960
Ref to computed to effectReactive core10,0009.7910.070
1 ref, 1,000 computeds, 1 effectReactive core1,0000.560.640
Mount 1,000 bound effectsReactive core1,0001.061.25361

Medians move by up to about 15% between runs on the same machine; mount times, which create the most garbage, move the most. Two move far more, set by when Roblox collects garbage rather than by Lucy: reading a table after a write (3.2 MB a run) takes about 0.5 ms, or 5 to 6 ms when a collection lands in it, and mounting 1,000 bound effects takes about 0.6 ms on its own (only) but up to 1.1 ms after the suites before it.

Since October a Switch costs about a third more to mount: it gained sizes (sm to xl), a slot for what follows its label, and named colours.

What the numbers mean

  • Lists and HUDs update only what changed. Editing one row in a list of 1,000 costs about 5 µs, and only that row's label runs again. A busy HUD frame, 50 values feeding 200 labels in one batch, takes 0.4 ms: under 3% of a 60 FPS frame. Neither creates garbage.
  • A bound label costs about 2 µs to update. One value read by 1,000 labels updates all of them in 2 ms.
  • Components update only what changed. Setting a Button's text sets its Text again and nothing else: about 4 µs per Button, no garbage. Disabling one (a tag, Interactable and Selectable) takes about 6 µs. A Switch toggle, thumb animation included, takes about 8 µs.
  • Mounting is where the cost is paid. A keyed row (a TextLabel with a bound text) takes about 15 µs and 2.2 KB to build. A Button takes about 50 µs and 7.8 KB, a Switch about 160 µs and 15 KB, much of it creating and parenting instances. Each bound state key adds a binding, which is what lets later updates skip everything else. Build UI once and update it, rather than rebuilding it.
  • Store writes cost the same however many components exist. A write to one component costs the same with 10 or 1,000 mounted, and it notifies only the subscribers on its path.
  • Reading a whole table copies it. app.state:get on a table that just changed builds a new frozen copy (about 30 KB for 1,000 keys), and reuses it until something inside changes. For values you read often, use app.state:ref, app.state.root or a binding: they read single keys and copy nothing. Setting a table equal to what is there compares the contents and notifies nobody.
  • Refs, computeds and effects are cheap. A write that flows through a computed into an effect takes about 1 µs and creates no garbage. With 1,000 computeds reading one ref and one effect reading all of them, each computed costs under 1 µs and the effect runs once.
  • Teardown is cheap, and keyed lists keep their rows. Clearing or destroying a list of 1,000 rows unbinds each row before its instance goes. Reversing 1,000 rows moves every instance instead of rebuilding it.

Method

Each iteration runs a suite's setup (not timed), then run (timed with os.clock), then teardown (not timed), so every iteration starts from fresh state.

  • Time covers Lucy's own work: creating instances, binding properties and running effects. Universal Styling resolves styles a few frames later inside the engine, so it is not part of any number here.
  • Heap is the growth of the Luau heap across run, read with gcinfo(). Roblox cannot force a collection, so treat it as a guide rather than an exact allocation count. Samples cut short by a collection are dropped, and the column shows n/a if none are left. Memory the engine holds for instances is not included.

Running them

In the Lucy dev place, from the command bar or the Studio MCP:

local Run = require(game.ReplicatedStorage.LucyTests.Bench.Run)
Run.run()                                -- every suite; prints a markdown table
Run.run({ only = "List" })               -- suites whose name matches a pattern
Run.run({ iterations = 30, warmup = 5 }) -- the settings used above
Run.run({ scale = 0.1 })                 -- smaller sizes, for a quick check

run returns { results, markdown, environment }. tests/Bench/Bench.spec.luau runs every suite at 1% of its size as part of the normal test run, so the benchmarks keep working as Lucy changes.

To add a suite, append it to tests/Bench/Suites.luau with a name, group, size, description, setup, run and teardown. Keep anything you do not want timed in setup and teardown.