Repository navigation
Performance
Dylan Brose edited this page Aug 30, 2026
·
3 revisions
DNS stays cheap if you only talk when a machine is paired and a job needs work. How often you poll is what costs.
- Track pair with
onPair/onUnpair/isPaired. The client already loads your pack’s pair entries once. - Do not start new jobs on unpaired machines. A job already in progress may finish locally after unpair (
outputsReadywhile unpaired isunpaired, no drain). -
forgetPairon your machine break ifisPaired, and onunpairedreplies (forgetPairalso drops machine pull).
- Prefer
signal: true. Start or inspect the job ononWake(and ononPair, or after a successful finish if you chain). Do not poll every advertised machine every tick to see if a job can start. -
outputsReadyonce at job complete. DNS retries drain when storage or power unblocks andwakes you if items actually moved. - Polling outputs (
signalomitted) runs about once per second. Use that only when you cannot signal.
-
subscribeEnergyPull(at, wantPerTick)while paired and the buffer is not full (even with no job).wantPerTickis usually remaining room. -
subscribeEnergyPush(adapter, canPushPerTick)while you have surplus to push into DNS. - Do not subscribe in a per-machine per-tick loop.
- Return watts you cannot store. Send less than allocated on collect if you cannot give that much.
- Unsubscribe when full / empty / your block break. The client unsubscribes machine pull on unpair. Do not drop Adapter pull/push on machine unpair.
- After world reload, re-subscribe already-paired machines yourself (Installation). Re-subscribe Adapter pull/push at the Adapter you remembered or found again.
- One-shot: subscribe, handle that block on the next offer/collect, unsubscribe.
-
"dorios": do not subscribe; DNS writes the tank.
-
clearAdapters,addAdapterfor each machine type, then oneregister({ source })per world load. Do not rebuild and re-register every tick.
- Items and craft: Gateway only (
hasTag("xxdmogxx_dns:gateway")). - Pair, wake,
outputsReady, and machine ipc pull: your machine's coordinates. - Energy stock, Adapter pull, and Adapter push: the Power Adapter you chose (
hasTag("xxdmogxx_dns:energy_port")). Remember it or find it again — DNS does not pick one from your cables.
Do not save Machine Interface coordinates.
Start
Using DNS
Reference