[0.15.37] Benchmark results are not logged

Bugs that are actually features.
Post Reply
mulark
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Wed Oct 18, 2017 11:32 pm
Contact:

[0.15.37] Benchmark results are not logged

Post by mulark »

When launching the game in benchmark mode, none of the results end up in the factorio-current.log

Launch options:

Code: Select all

--benchmark "015 Mega.zip" --benchmark-ticks 5000 --disable-audio
Output from command line:
Performed 5000 updates in 110029.316 ms
avg: 22.006 ms, min: 19.962 ms, max: 31.754 ms
140.101 Goodbye
Attachments
factorio-current.log
(19.03 KiB) Downloaded 77 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.37] Benchmark results are not logged

Post by Rseding91 »

Thanks for the report. That's working as intended: none of the output from the developer options we have write to the log file. If you use them you're expected to redirect the output of the thing you're running or run it through a console to read the output.
If you want to get ahold of me I'm almost always on Discord.

mulark
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Wed Oct 18, 2017 11:32 pm
Contact:

Re: [0.15.37] Benchmark results are not logged

Post by mulark »

Unfortunately output redirection seems broken on Windows at the moment.

Example:

Code: Select all

./factorio.exe > testfile.txt
No output is redirected to testfile.txt

As a note this does work on Linux

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.37] Benchmark results are not logged

Post by Rseding91 »

mulark wrote:Unfortunately output redirection seems broken on Windows at the moment.

Example:

Code: Select all

./factorio.exe > testfile.txt
No output is redirected to testfile.txt

As a note this does work on Linux
Most things aren't sent to std::out and you've told it nothing special so it's all sent to the log file only. If you use something like benchmark it will send it *only* to std::out.
If you want to get ahold of me I'm almost always on Discord.

mulark
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Wed Oct 18, 2017 11:32 pm
Contact:

Re: [0.15.37] Benchmark results are not logged

Post by mulark »

I've tried both

Code: Select all

.\factorio.exe --benchmark reference.zip --benchmark-ticks 1234 > test_result.txt
.\factorio.exe --benchmark reference.zip --benchmark-ticks 1234 | tee test_result.txt
In powershell and cmd. Nothing but 0 byte files.
Of course I wouldn't be surprised if this is just windows being fudgy.


For googlers: workaround powershell script to extrapolate avg ms from the log file (min and max ms are lost)
(at an interval of 1000 ticks result was off by 3ms, at 10000 ticks, off by 0.2ms)

Code: Select all

# Number of ticks to run
$ticks = 10000

# Name of map
$map = "reference.zip"

function cut {
  param(
    [Parameter(ValueFromPipeline=$True)] [string]$inputobject,
    [string]$delimiter='\s+',
    [string[]]$field
  )

  process {
    if ($field -eq $null) { $inputobject -split $delimiter } else {
      ($inputobject -split $delimiter)[$field] }
  }
}


./factorio.exe --benchmark $map --benchmark-ticks $ticks --disable-audio | out-null
copy ..\..\factorio-current.log .
$array = cat .\factorio-current.log | cut -f 1 | Select-Object -last 2
$ms = [math]::Round(($array[1] - $array[0]) / ($ticks / 1000),3)
echo $ms | tee test_results.txt
pause
In any case output redirection now works in 0.16.51, in case you are from the future.
And if you are, here's what you may be looking for: https://github.com/mulark/factorio_benchmark_scripts
Last edited by mulark on Fri Aug 03, 2018 2:42 am, edited 1 time in total.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: [0.15.37] Benchmark results are not logged

Post by DaveMcW »

Do the developers benchmark anything on Windows? Could they share their logging script?

Post Reply

Return to “Not a bug”