Page 1 of 1
[0.15.37] Benchmark results are not logged
Posted: Thu Oct 19, 2017 12:21 am
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
Re: [0.15.37] Benchmark results are not logged
Posted: Thu Oct 19, 2017 12:51 am
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.
Re: [0.15.37] Benchmark results are not logged
Posted: Thu Oct 19, 2017 2:25 am
by mulark
Unfortunately output redirection seems broken on Windows at the moment.
Example:
No output is redirected to testfile.txt
As a note this does work on Linux
Re: [0.15.37] Benchmark results are not logged
Posted: Thu Oct 19, 2017 3:13 am
by Rseding91
mulark wrote:Unfortunately output redirection seems broken on Windows at the moment.
Example:
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.
Re: [0.15.37] Benchmark results are not logged
Posted: Thu Oct 19, 2017 5:45 am
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
Re: [0.15.37] Benchmark results are not logged
Posted: Thu Oct 19, 2017 7:29 am
by DaveMcW
Do the developers benchmark anything on Windows? Could they share their logging script?