Page 1 of 1

Benchmark testing help

Posted: Mon Sep 25, 2017 12:26 am
by Sicnarf
Was trying to do some UPS efficiency testing of designs in creative mode but the game update fluctuates so much it's hard to get a good reading.
I have heard tell of a benchmark testing mode and found the below commands in the wiki however I'm unclear as to how to use them.

--benchmark FILE load save and run benchmark
--benchmark-ticks N (=1,000) number of ticks for benchmarking. Default is 1000

I'm presume I append something like the below to the end of the executable ->
--benchmark-ticks 18000 TestSaveFileName

At which point I presume the game will launch, load the specified save and benchmark it over 5 minutes?
I'd have tested this already but I'm running linux and appending things is not as straight forward as windows was for me at least. So before I quest though some Ubuntu forums can anyone confirm this for me? Also advice and suggestions welcome.

Re: Benchmark testing help

Posted: Mon Sep 25, 2017 12:45 am
by Jap2.0
They look like two separate commands to me. Sorry I can''t help beyond that.

Edit: Nevermind, it looks like it should be

Code: Select all

--benchmark [file] -ticks [N]

Re: Benchmark testing help

Posted: Mon Sep 25, 2017 1:13 am
by impetus maximus
not sure, but creative mod might have some hoggish items that could hurt your overall UPS.

Re: Benchmark testing help

Posted: Mon Sep 25, 2017 11:19 am
by Jap2.0
Yes - I'd design it in creative, then test it without mods.

Re: Benchmark testing help

Posted: Thu Sep 28, 2017 11:56 pm
by Sicnarf
Could not figure out how to get it working in the end, the combination of Steam and Ubuntu is to much for me.
The shortcut lists a game ID, tried appending to it but it was no help. Tried appending directly to the executable (Factorio) just caused Factorio to download a new executable.
(Exec=steam steam://rungameid/427520)

I give up if anyone figures it out please let me know.
I'm going back to Windows when I build my next PC.

Re: Benchmark testing help

Posted: Fri Sep 29, 2017 2:46 am
by quyxkh
The benchmarking's set up for command-line use. Run it from a terminal. If Ubuntu uses nautilus you should be able to type "Factorio" with any nautilus window active, open the one ending "/common/Factorio", and rclick-Open in Terminal to get there.

But maybe they've got it dumbed down far enough that "open in terminal" isn't an option, I don't know if the one I saw was set up that way by the local admin or that's a widespread choice. So, just in case, the guaranteed-to-work way is to open a terminal and

Code: Select all

locate -i \*/Factorio # or if that doesn't work, find ~ -iname Factorio
cd the/one/ending/in/common/Factorio
ln -s "$PWD" ~
which will set you up to "cd ~/Factorio" from any command prompt in the future.

Then you can e.g..

Code: Select all

bin/x64/factorio --benchmark saves/"your save.zip" --benchmark-ticks 100000
to run your benchmarks. It prints the timing data when it's done.

I've been making a mod to help with benchmarking, try it out if you don't mind using trains. It prints production and delivery stats to the terminal and provides (barely) enough convenience tools that you don't need creative mode or void chests to rig a blueprint for benchmarking, although it's certainly not as convenient as either of those for sketching.

Re: Benchmark testing help

Posted: Fri Sep 29, 2017 6:06 pm
by Sicnarf
Thanks quyxkh your a life saver, going to add what I found out in case anyone else needs the info in future.
The folders that store the game are hidden folders so they don't show up in standard searches.
Mine is located in ->
${HOME}/.local/share/Steam/steamapps/common/Factorio/

The save games are not located in the same folder tree they are stored in a separate hidden folder ->
${HOME}/.factorio/saves/

Command I ended up running after navigating to the factorio folder->
bin/x64/factorio --benchmark /home/username/.factorio/saves/"Ribbon53.zip" --benchmark-ticks 18000

Did not realise this was all going to be command line including the results. The map I fed it is a 1kspm base that runs around 50 UPS, below is the results it spit out after 5 min. Going to have to do some playing with this.
Performed 18000 updates in 300664.899 ms
avg: 16.704 ms, min: 14.151 ms, max: 33.146 ms
326.847 Steam API shutdown.
326.849 Goodbye

Re: Benchmark testing help

Posted: Sat Oct 07, 2017 10:59 pm
by Sicnarf
Well Linux had a fit and my browser stopped working. So I gave windows 7 a try and tried using the benchmark testing via windows command prompt.
I can append the benchmark commands without issue but command prompt will not spit out any results to me when the benchmark is finished.
Command prompt starts the steam API and then gives me no more data after that point, factorio launches and appears to run the benchmark and then closes. Command prompt still shows Initializing Seam API.
Anyone know how to get results from benchmark via the windows steam version?

Re: Benchmark testing help

Posted: Sun Oct 08, 2017 9:30 am
by posila
Steam API will restart the game under the Steam process if it was launched from outside of Steam. I suggest you to use non-steam version for running benchmarks.

Re: Benchmark testing help

Posted: Sun Oct 08, 2017 12:48 pm
by Sicnarf
Thanks posila had no idea that buying the steam version gave me access to the non steam one.

Weird I'm getting better speeds on windows than I did on linux using the same save, don't know if it's because the Linux install was a couple of years old and this windows install is fresh. Then again game might be better optimized for Windows.

How to run the command in Windows via command prompt, navigate the command prompt to the below folder location and run the command listed after the location.
C:\Program Files\Factorio\bin\x64>factorio --benchmark "UPS8BeaconBot.zip" --benchmark-ticks 18000

Results
Performed 18000 updates in 288273.957 ms
avg: 16.015 ms, min: 13.500 ms, max: 30.918 ms