UPS optimization - say Substations once more...

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

UPS optimization - say Substations once more...

Post 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 4732 times
Map-Wireconfigs-.png
Map-Wireconfigs-.png (36.4 KiB) Viewed 4732 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 4732 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
Attachments
saves.zip
(28.81 MiB) Downloaded 173 times
b_smeltwiret results.csv
(2.22 KiB) Downloaded 158 times
coppercoil
Filter Inserter
Filter Inserter
Posts: 502
Joined: Tue Jun 26, 2018 10:14 am
Contact:

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

Post by coppercoil »

First thought: wtf???
Second thought: lets make the graph correct.
Offset_0
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

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

Post 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?
coppercoil
Filter Inserter
Filter Inserter
Posts: 502
Joined: Tue Jun 26, 2018 10:14 am
Contact:

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

Post 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.
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

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

Post 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 4576 times
Attachments
bm_iron-DaveMcWs.zip
(1.25 MiB) Downloaded 101 times
bm_iron-belter-v6.75s.zip
(2.73 MiB) Downloaded 174 times
bm_ smelting results.csv
(2.41 KiB) Downloaded 142 times
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3715
Joined: Tue May 13, 2014 11:06 am
Contact:

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

Post 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.
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

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

Post 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)
Attachments
bm_ smelting results.csv
(10.21 KiB) Downloaded 208 times
bm_iron-DaveMcWs.zip
(1.25 MiB) Downloaded 182 times
bm_iron-belter-v6.75s.zip
(2.73 MiB) Downloaded 200 times
bm_smeltwiret_1_Belter-smin.zip
(3.93 MiB) Downloaded 157 times
bm_smeltwiret_2_Belter-s.zip
(3.01 MiB) Downloaded 90 times
bm_smeltwiret_3_Belter-pmin.zip
(3.4 MiB) Downloaded 89 times
bm_smeltwiret_4_Belter-p.zip
(3.24 MiB) Downloaded 90 times
bm_smeltwiret_5_Belter-pmax.zip
(3.14 MiB) Downloaded 89 times
bm_smeltwiret_6_Belter-pmaxx.zip
(4.02 MiB) Downloaded 89 times
logs.zip
(63.22 MiB) Downloaded 113 times
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

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

Post 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 4513 times
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

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

Post 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
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

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

Post 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
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

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

Post 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?
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

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

Post 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.
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

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

Post by Belter »

Lets continue at viewtopic.php?p=561883#p561883 where we came from.. :)
Post Reply

Return to “Combinator Creations”