Skip to content

Instantly share code, notes, and snippets.

@numberoverzero
Created August 11, 2018 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save numberoverzero/8d10e73b663add2032c3e9226f41b2dd to your computer and use it in GitHub Desktop.
Save numberoverzero/8d10e73b663add2032c3e9226f41b2dd to your computer and use it in GitHub Desktop.
notes from benchmarking factorio's rcon capabilities
tool: rcon-cli https://github.com/itzg/rcon-cli
control.lua:
function Bench(x)
rcon.print(x+3)
end
commands.txt:
/silent-command Bench(2)
[9998 more copies]
/c print("done")
filebench.sh
#!/usr/bin/env bash
cat commands.txt | ./rcon-cli --password hunter2 > /dev/null
$ time ./filebench.sh
real 2m48.088s
user 0m0.625s
sys 0m1.094s
commands/sec: 10001/168.088 = 59.50 [60/sec]
sec/command: 168.088/10001 = 0.017 [17ms]
@numberoverzero
Copy link
Author

Subsequent runs are all within +/- .05 commands/sec or ~0.0168sec/command. Which means the rcon server is probably tied to the main game thread: https://wiki.factorio.com/Game-tick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment