Page 1 of 1

[0.17.X] Optimize UPS @ Electric Networks plz

Posted: Thu May 16, 2019 2:43 pm
by YunoAloe
In debug mode my electric network is shown to consume as much time as entities, at 3 msec each currently, and they grow together as I build my base. I'm playing ~100 mods of ABPy+ game, consisting almost entirely from top-trending stuff. I can't find anyone on the internet mentioning electric network being the top consumer of UPS. Can somebody point me to any tips on optimizing electric networks, like replace all poles with substations? Maybe some known mods can cause this, like Factorissimo? I set electric updates to be 2 times less often in it, it noticeably (10-20%) reduced time usage by Factorissimo script, but not by electric network.
Also, is there a way to further debug this?

Added some screenshots.
3.4 for entities, 2.3 for electric network. The base is not big for now:
20190516225458_1.jpg
20190516225458_1.jpg (669.26 KiB) Viewed 2435 times
Everything is on one network (enabled show-network-connected-entities & show-energy-sources-networks):
20190516225333_1.jpg
20190516225333_1.jpg (1.12 MiB) Viewed 2435 times
But each factory building has it's own network:
20190516225800_1.jpg
20190516225800_1.jpg (550.35 KiB) Viewed 2435 times
And I have about 80 of those buildings. Does Factorio not like multiple networks perhaps?

Also attached modlist with mods settings, should they be needed.

Re: [0.17.X] How to optimize UPS @ Electric Network?

Posted: Thu May 16, 2019 9:05 pm
by YunoAloe
Around half of my base is in factories. After I uprooted all factory buildings (I assume they still exist as surfaces, with their contents and respective networks, just not connected anymore and power-drained), timing dropped from 2.3 to 1.5. After I disabled Factorissimo, timing dropped to 0.27. :(

Re: [0.17.X] How to optimize UPS @ Electric Network?

Posted: Thu May 16, 2019 9:41 pm
by orzelek
YunoAloe wrote:
Thu May 16, 2019 9:05 pm
Around half of my base is in factories. After I uprooted all factory buildings (I assume they still exist as surfaces, with their contents and respective networks, just not connected anymore and power-drained), timing dropped from 2.3 to 1.5. After I disabled Factorissimo, timing dropped to 0.27. :(
Thats the drawback of Factorissimo - it needs to transfer all the resources between surfaces in lua. It's pretty efficient but as you get more of them it will show up in stats.

Re: [0.17.X] How to optimize UPS @ Electric Networks, Factorissimo?

Posted: Sun May 19, 2019 2:02 pm
by YunoAloe
I'd really love someone from Factorio staff to comment on this.

- Is this issue known?
- Is the problem in multiple networks, multiple surfaces, or something else?

And most importantly:
- Do you consider giving electric networks some (threaded?) love like you did to fluids lately? Factorissimo is one of the most popular mods, and the very trending Earendel's Space Exploration is using surfaces too, and there are new ones likely to come. Having performance of 100 electric networks being 5-10 times worse than 1 of same total size is definitely showing potential for improvement.

Re: [0.17.X] Optimize UPS @ Electric Networks plz

Posted: Mon May 20, 2019 11:55 pm
by Rseding91
It's working correctly. Electric networks are designed for their primary use-case: one large network. Multiple tiny networks will perform much worse than the one big network.

It's not a "hasn't been optimized for small networks" but a "has been optimized for large networks". You can't get both: making small networks faster would make large ones slower.

Trying to run them in threads also isn't likely to ever happen since the primary use case is one big network which would see zero advantage to being run in another thread and in fact would just run slower due to the thread overhead.

Re: [0.17.X] Optimize UPS @ Electric Networks plz

Posted: Tue May 21, 2019 11:31 am
by YunoAloe
Thanks for commenting. I guess I'll have to unpack half my base from factories then, as with such trend it'll be impossible to finish an ABPy+ game without UPS drops. It's still doable at this point...

Re: [0.17.X] Optimize UPS @ Electric Networks plz

Posted: Tue May 21, 2019 9:02 pm
by MagmaMcFry
Rseding91 wrote:
Mon May 20, 2019 11:55 pm
It's working correctly. Electric networks are designed for their primary use-case: one large network. Multiple tiny networks will perform much worse than the one big network.
In that case I'd really like for Factorio to support connecting electric networks across surfaces, so I can get Factorissimo to work within the optimized case. Would such a cross-surface connection feature mess with optimization too?

Re: [0.17.X] Optimize UPS @ Electric Networks plz

Posted: Wed May 22, 2019 12:45 am
by Rseding91
MagmaMcFry wrote:
Tue May 21, 2019 9:02 pm
Rseding91 wrote:
Mon May 20, 2019 11:55 pm
It's working correctly. Electric networks are designed for their primary use-case: one large network. Multiple tiny networks will perform much worse than the one big network.
In that case I'd really like for Factorio to support connecting electric networks across surfaces, so I can get Factorissimo to work within the optimized case. Would such a cross-surface connection feature mess with optimization too?
Cross-surface entities/mechanics is something I've been thinking about for some time.

Re: [0.17.X] Optimize UPS @ Electric Networks plz

Posted: Wed May 22, 2019 5:32 am
by Koub
[Koub] Considering the above, I'm moving this to Ideas and suggestions.