Performance
These numbers come from the benchmark suite in the repository (tests/bench and tests/memory), run in Roblox Studio with Lest. Each measurement runs over 1000 machines for 21 rounds. The tables give the fastest round and the median round, in microseconds for one call, taken as the middle of three runs. Read them as a guide to which calls are cheap and which are not: a different machine, or the same machine on another day, gives different numbers.
Recorded on 2026-12-06 at commit 5e3f8c5, in benchmarks/0.1.0-regions.json.
What to take from it
- A machine that is waiting is almost free.
processon a machine with nothing due checks one cached time, about 0.05 µs, however deep its states are. A group does better still: a machine in it that is only waiting costs nothing per call, about 0.01 µs each when spread over a group of 1000. - A move costs under a microsecond. Leaving and entering states makes a new run for each state entered, so moves allocate. Their medians vary more than their fastest rounds, because the garbage collector runs in some rounds.
- The extras are cheap. A
canEnteradds about 0.1 µs to a move, a kept event about 0.25 µs to eachprocessuntil it is taken, andhasTagcosts the same asisIn. - Reading is cheap.
isIn,hasTag,getLeafandgetRundo not allocate.getPath,getRecordsandgetEntriesreturn copies, so they allocate a table. - A machine takes about 1.3 KB with two flat states, and grows with the depth of the path it is in.
Making and processing
| Measurement | Fastest (µs) | Median (µs) |
|---|---|---|
| Make a machine, flat tree | 0.74 | 1.87 |
| Make a machine, three levels deep | 1.16 | 2.73 |
| Make a machine with a history | 1.18 | 2.87 |
process, idle, no duration | 0.05 | 0.06 |
process, idle, duration not ended | 0.05 | 0.06 |
process, idle, three levels deep | 0.05 | 0.06 |
process, an onProcess that stays | 0.18 | 0.20 |
process, a time-up that moves | 0.90 | 1.45 |
process, a time-up that moves, after a timeline cue | 1.44 | 1.78 |
process, one event kept in the buffer | 0.29 | 0.32 |
Events and moves
| Measurement | Fastest (µs) | Median (µs) |
|---|---|---|
send, no state handles it | 0.19 | 0.20 |
send, no state handles it, kept in the buffer | 0.25 | 0.28 |
send, a move | 0.66 | 0.74 |
send, a move through canEnter | 0.77 | 0.94 |
send, handled three levels up | 1.00 | 1.32 |
send, a move into a state with memory | 0.75 | 1.22 |
send to a parallel, two regions that both move | 1.99 | 2.77 |
goTo, flat | 0.56 | 0.62 |
goTo, into a timed state | 0.63 | 0.82 |
goTo, with every hook | 0.64 | 0.99 |
Reading
| Measurement | Fastest (µs) | Median (µs) |
|---|---|---|
isIn | 0.05 | 0.06 |
hasTag | 0.06 | 0.07 |
getLeaf | 0.04 | 0.05 |
getPath | 0.09 | 0.15 |
getRun | 0.06 | 0.06 |
History
| Measurement | Fastest (µs) | Median (µs) |
|---|---|---|
| A move into a recorded state | 1.09 | 1.70 |
endsWith, three records | 0.11 | 0.12 |
getRecords | 0.89 | 1.20 |
getLast | 0.13 | 0.32 |
Groups
Per machine in a group of 1000, for one group:process.
| Measurement | Fastest (µs) | Median (µs) |
|---|---|---|
| Every machine waiting | 0.01 | 0.01 |
| Every machine due, each moving | 1.31 | 1.69 |
Memory
The bytes one newly made machine takes, with its runs. A machine that has moved is not measured: Roblox cannot force a garbage collection, so the garbage its moves leave would land in another reading.
| Machine | Bytes |
|---|---|
| Two flat states | 1315 |
| Three levels deep | 2017 |
| In a state with memory | 1359 |
| With a history | 1903 |
These are about 120 bytes higher than the recording of 2026-12-05. The same code measured again on 2026-12-06 (benchmarks/0.1.0-features-again.json) reads the same as today's, so the difference comes from the Studio version, not from Canopy.
Running the benchmarks
With Roblox Studio installed, run bench record at the root of the repository to measure the current code, and bench compare <old> <new> to compare two recordings. benchmarks/README.md describes both.