Page 1 of 1

UPS optimization - say Substations once more...

Posted: Tue Feb 15, 2022 8:01 am
by Belter
Subsations vs Poles vs UPS optimization
- I was interested what is the real impact of different electricity wiring setups
- Using 5x100 lanes of Iron Ore -> Iron Plate setups, 3 x 50.000 ticks for benchmarking
Wires-anim-.gif
Wires-anim-.gif (13.5 MiB) Viewed 4060 times
Map-Wireconfigs-.png
Map-Wireconfigs-.png (36.4 KiB) Viewed 4060 times
Results - TL;DR: just use poles
- Unless you create a mess poles are OK. Substations often won't fit anyway to optimized layouts
- There might some errors in my benchmark (the two slowest), but I don't expect any major finding here
- We're close to the margin of error
- Saves attached
UPS.png
UPS.png (85.47 KiB) Viewed 4060 times
#1 Substations Min
- High hopes, optimized # of substaitons per row to 2
#2 Substations Norm
- 4 substations per row, modular BP
#3 Poles Min
- Removed some cables from the normal wires setup (#4) to see the difference
- OK this was a pain as region cloner won't keep this
- Results might be wrong
#4 Poles Norm
- Normal pole setup - optimized of course to minimal number of poles - 18/row
- Modular BP
#5 Poles Max
- Added extra wires to #4
#6 Poles Mess
- Added poles to all empty spaces just for testing

Re: UPS optimization - say Substations once more...

Posted: Tue Feb 15, 2022 9:00 am
by coppercoil
First thought: wtf???
Second thought: lets make the graph correct.
Offset_0

Re: UPS optimization - say Substations once more...

Posted: Tue Feb 15, 2022 1:07 pm
by Belter
coppercoil wrote:
Tue Feb 15, 2022 9:00 am
First thought: wtf???
Second thought: lets make the graph correct.
First thought: You're right.
Second thought: Do you see the 1% mark with yellow on that graph?

Re: UPS optimization - say Substations once more...

Posted: Tue Feb 15, 2022 4:25 pm
by coppercoil
No, I missed that. I did not found yellow color on the graph and skipped the following text :D. You know, browsing nowadays is about skipping 95% unnecessary information, this works on a driver layer 8-)

Nevertheless... 1% is still unexpected.

Re: UPS optimization - say Substations once more...

Posted: Tue Feb 15, 2022 4:27 pm
by disentius
Dave's version is still faster:)
The difference between min-max in my previous test bothered me, so
- I shut down all other programs and windows on my PC.
- left it alone during the test.
it seems to prevent "outliers"
2022-02-15 17_24_51-bm_ smelting results.csv - LibreOffice Calc.png
2022-02-15 17_24_51-bm_ smelting results.csv - LibreOffice Calc.png (77.94 KiB) Viewed 3904 times

Re: UPS optimization - say Substations once more...

Posted: Tue Feb 15, 2022 5:11 pm
by DaveMcW
It's possible you both are correct. :)

After disentius made the map 13 times smaller and shut down everything else, he was able to fit all the active entities in CPU cache and never touch RAM. So it is not affected by storing extra entities in RAM.

Belter was forced to use RAM access, and all the extra entities slowed it down.

I wonder if we could optimize the RAM layout, by building the poles after everything else? This is not really practical in a normal game.

Re: UPS optimization - say Substations once more...

Posted: Tue Feb 15, 2022 8:20 pm
by disentius
I made all belter's saves from the last post 100 belts, and ran them all 10 times together with davemcw's with substations, and belters V6.75
No activity on PC while testing
Results: Dave still wins (with my modifications)

Re: UPS optimization - say Substations once more...

Posted: Tue Feb 15, 2022 8:20 pm
by disentius
2022-02-15 21_17_10-bm_ smelting results.csv - LibreOffice Calc.png
2022-02-15 21_17_10-bm_ smelting results.csv - LibreOffice Calc.png (99 KiB) Viewed 3841 times

Re: UPS optimization - say Substations once more...

Posted: Wed Feb 16, 2022 8:57 am
by Belter
TY for testing!

It is pretty interesting to have different results, even if the diff is low. For now we see diff output for 100 and 500 lanes. Havig the savegames is crucial and TY for attaching.

On the weekend I'll do a scalability testing w/100/200/300/400/500 lanes to understand the difference. Any chance to run 500 lanes test justs to see it somewhere else as well? I'll do a 100 lane test as well. I've chosen 500 lanes as on my old computer it runs around 130FPS w/UI, so its "playable" and minimizes the "fixed" UPS cost of the game I assume. Better BPs should perform better whatever lanes we're testig with though. It is faster to test w/100 lanes, yes.

Also why substations helps for DaveMcW's BP, but same or worse for me?

I really appreciate the effort and interest here and the smelting thread - hope we won't end up trying to prove which BP is faster. Wait, I've just said I'll do more tests.. for science :D

Re: UPS optimization - say Substations once more...

Posted: Wed Feb 16, 2022 9:17 am
by disentius
Welcome!
yes, the why of it all is interesting. I am not sciency/knowledgeable enough about the technical side of factorio/computers to make a good hypothesis.
(That is why I also included the original logs) I hope we get a true nerd to help...:)

What I can do, is consistent testing. I ll see If I can run another one today. Do you have the original blueprint of the versions you want tested?
And a feature request: keep the timers apart, I ant to use 1 timer per map of 100/300/500 furnaces)
Also the reported UPS is a derived value made in the script I use, so i tend to use the execution time, min/max/avg as reported by the benchmark command as leading

Re: UPS optimization - say Substations once more...

Posted: Wed Feb 16, 2022 9:19 am
by disentius
There is something with the "max" values. the ones from your builds are twice as high as the ones from davemcW's
Maybe you can plot avg/max/min over time for both saves?

Re: UPS optimization - say Substations once more...

Posted: Sat Feb 19, 2022 7:03 pm
by Belter
disentius wrote:
Wed Feb 16, 2022 9:17 am
And a feature request: keep the timers apart, I ant to use 1 timer per map of 100/300/500 furnaces)
OK, let's agree on this.
disentius wrote:
Wed Feb 16, 2022 9:17 am
Also the reported UPS is a derived value made in the script I use, so i tend to use the execution time, min/max/avg as reported by the benchmark command as leading
The scirpt also uses execution time (1000 * $ticks / $executionTime), which is calculated form the avg ms numbers.
Honestly its simpler to use this UPS for graphs as it is there.

Re: UPS optimization - say Substations once more...

Posted: Sat Feb 19, 2022 7:05 pm
by Belter
Lets continue at viewtopic.php?p=561883#p561883 where we came from.. :)