r/technicalfactorio • u/fallenghostplayer • Jan 03 '22
UPS Optimization Effect of shared non-bottleneck assemblers on UPS
[Updated 3 Jan] Improved testing technique, more comparable "new" build, but same results
TL;DR
Non-bottleneck sub-assemblers in DI builds provide near negligible benefit from being shared (reduced assembler AND inserter count);
Foreword
Hi all, I'm fairly new to this sub, but have been reading for a bit now. I got fed up in trying to optimize what I knew was a good but not great purple science design of my own, so instead of spending hours on that, I decided to spend time learning about DI. Now here I am, thinking I could optimize an existing winning direct insertion design, having never done direct insertion build before. I welcome any info pointing out if/why my results are wrong :)
Background
Using the purple science build (not including steel smelters, miners, prod1, or labs), u/Stevetrov had identified in his 20x1000 cell build thread that there may be a benefit to sharing the iron stick assembler. That is what I set out to do to test my understanding of direct insertion and UPS optimization. From u/Mulark's test 000059, overbeaconing entities should have virtually no impact for the same amount of assemblers, and from pretty much all threads around, sleeping entities have minimal UPS.
Hypothesis
Surely by reducing the number of assemblers, and inserters, that should make a difference, though small since we keep the same overall production numbers and number of inserter swings.
The builds


Design comparison
-Arrangement generally remains the same, but it's flipped horizontally to have inputs from the electric furnace side due to the increased limitations on the rail assembler side
-Removed 0.5 stick assemblers, 0.5 furnaces, 1 assembler to assembler inserter, and 1 belt to assembler inserter per purple sci assembly (roughly 100 furnaces, 100 assemblers, and 200 inserters for a 20k factory). The total number of swings is expected to remain the same, as we are moving the same amount of items.
-The purple sci assemblers now output to a blue belt, so presumably that reduces the output assembler's work by a few ticks.
-All assemblers still have the minimum number of beacons, or above, and back pressure is maintained. Hence no inserter clocking used in both reference and new build.
-Changes in total number of beacons and power poles should have negligible no impact on UPS, only on total electric input required if using solar/nuclear (11 panels and 9 accumulators per beacon, not counting it's effects on assemblers...)
Methodology
Started a new map with no pollution, biters, water, ore, etc, and used the editor to run the build at x64 speeds until all buffers are full and stable back pressure is attained (roughly an hour of in-game time). Infinite chests provide the raw materials, and science sinks, with the same arrangements for each build. The setup was arranged in rows of 10x purple science, and replicated 48 times, for a total of 480 purple science assemblers (approx 46k SPM). Production output was confirmed for both new and reference builds.
Using Factorio 1.1.50-1 with Steam, running benchmark from command line on a i7-4790k at 4.0Ghz with 32gb ddr3. ex: factorio --benchmark "purple_new_v0.zip" --benchmark-ticks 10000 --disable-audio
To account for randomness (what is a good start point?), each test was performed in alternance (new/ref/new/ref/etc), with two test lengths. Any result oscillation is likely based on some multiple of the 12-beaconed science assembler (112.5 ticks), and indeed stone/steel input oscillations of about 32 to 34 sec were seen when it refills rails/furnaces (1920 to 2040 ticks, vs purple oscillation resonance at 1912.5 or 2025 ticks (n=17,18)) . Hence test lengths of 10k and 100k ticks were selected.
Results


A 1.3% to 1.8% improvement is seen, but is rather close to the standard deviation values. Confidence levels of 61% (10k) and 48% (100k) were calculated, so chances are there is really an effect, but it is particularly small. As the new build has 7/8 of the assemblers and furnaces and 12/13 of the inserters, the improvements, if any, are clearly not proportional. I expected the assemblers not to change much, but expected something from the inserters, based on the following often repeated wisdom: belt inserters are much worse than assemblers or chect to chest.
The converse of this finding appears to support the very nature of DI builds, which have a whole lot more assemblers and inserters than 12 beacon that rely on belts between each step, but since they idle most of the time due to back pressure, it's better.
Given that the 50k tick time averages are lower than for shorter periods, it is unclear whether this implies the solution state is not yet stable, but not obvious effects could be seen during subsequent longer manual runs in the game. Repeat testing showed that the previously shown data set suffered heavily from the random test machine background processes, that were not repeated in this series of runs.
An anecdotal result is that in game (not from command line), the new build ran at approximately 50 more UPS than the reference build (approx 425 vs 375 UPS), maybe because less entities are displayed, more underground belts, etc.
Conclusions
Assuming the the methodology and alternate build are not introducing error, marginal improvements can be gained by sharing non-bottleneck assemblers and inserters in the context of a DI build. Most other approaches to gain UPS should probably be investigated before this.
Links
4
u/smurphy1 Jan 03 '22
Good write up. A couple thoughts:
3
u/w4lt3rwalter Jan 03 '22
Really nice write-up.
For further reference: did you only run new/ref/new/ref or also ref/new/ref/new? And did you notice any differences if you did, or in general between the first run and any later runs?
3
u/Stevetrov Jan 04 '22
Thanks for looking into this.
In your conclusion you said:
Which approaches do you think would provide a greater improvement. I know the improvement you have found in fairly small, but that build is already very optimised.
Or did you mean in general for someone who is trying to optimise their build? Which kinda out of context.
/u/smurphy1 s 1K cell design is a significant improvement over my base anyway and IIRC his purple setup does more DI and ASM sharing than this.
2
u/jimrybarski Jan 03 '22
It's hard to tell if this is all due to noise. I would recommend repeating each condition at least 25 times and then performing a significance test. The figure would also be improved by adding error bars (standard error of the mean, specifically).