Skip to content

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. process on 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 canEnter adds about 0.1 µs to a move, a kept event about 0.25 µs to each process until it is taken, and hasTag costs the same as isIn.
  • Reading is cheap. isIn, hasTag, getLeaf and getRun do not allocate. getPath, getRecords and getEntries return 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 ​

MeasurementFastest (µs)Median (µs)
Make a machine, flat tree0.741.87
Make a machine, three levels deep1.162.73
Make a machine with a history1.182.87
process, idle, no duration0.050.06
process, idle, duration not ended0.050.06
process, idle, three levels deep0.050.06
process, an onProcess that stays0.180.20
process, a time-up that moves0.901.45
process, a time-up that moves, after a timeline cue1.441.78
process, one event kept in the buffer0.290.32

Events and moves ​

MeasurementFastest (µs)Median (µs)
send, no state handles it0.190.20
send, no state handles it, kept in the buffer0.250.28
send, a move0.660.74
send, a move through canEnter0.770.94
send, handled three levels up1.001.32
send, a move into a state with memory0.751.22
send to a parallel, two regions that both move1.992.77
goTo, flat0.560.62
goTo, into a timed state0.630.82
goTo, with every hook0.640.99

Reading ​

MeasurementFastest (µs)Median (µs)
isIn0.050.06
hasTag0.060.07
getLeaf0.040.05
getPath0.090.15
getRun0.060.06

History ​

MeasurementFastest (µs)Median (µs)
A move into a recorded state1.091.70
endsWith, three records0.110.12
getRecords0.891.20
getLast0.130.32

Groups ​

Per machine in a group of 1000, for one group:process.

MeasurementFastest (µs)Median (µs)
Every machine waiting0.010.01
Every machine due, each moving1.311.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.

MachineBytes
Two flat states1315
Three levels deep2017
In a state with memory1359
With a history1903

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.