[boskid][1.1.0] Belt performance regression

This subforum contains all the issues which we already resolved.
zer0t
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon Nov 23, 2020 10:17 pm
Contact:

[boskid][1.1.0] Belt performance regression

Post by zer0t »

1. What did you do?
- Loaded my 1.0.0 save into 1.1.0

2. What happened?
- FPS/UPS dropped from 17 (at 1.0.0) to 3 (at 1.1.0)
- I let it run for about 10 minutes, but nothing changed

3. What did you expect to happen instead? It might be obvious to you, but do it anyway!
- at least equal performance like in 1.0.0
- maybe even better performance than in 1.0.0 (according to changelog there were some belt multithread improvements and this save has a lot of belts)

Save file / logfiles: https://nx7119.your-storageshare.de/s/KC6CWJfgK6wyqTS
Mods: None
Screen 1.0.0:
1.0.0.png
1.0.0.png (3.84 MiB) Viewed 10628 times
Screen 1.1.0:
1.1.0.png
1.1.0.png (4.53 MiB) Viewed 10628 times
Offtopic: Amazing game, amazing devs, pls keep on going :)

edit: updated link
Last edited by zer0t on Tue Nov 24, 2020 7:59 pm, edited 1 time in total.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2965
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by boskid »

Thanks for the report. Issue is now fixed for the next release.

Due to multithreaded update, transport lines have to be grouped. In your save file there is at least one huge group that contains 200k+ transport lines and any changes around it (adding or removing belts, splitter, rotating them etc..) will be causing lag spikes when that group is checked for possible split. Issue was that those groups were also being checked periodically in some other unnecesary cases. This save file will not benefit from multithreaded update because of that one huge group. To remove all the remaining lag spikes (when interacting with belts) i would have to disable the whole groupping logic and i will not sacrifice that just because of one extremally unfortunate save file.
orzelek
Smart Inserter
Smart Inserter
Posts: 3922
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by orzelek »

What are the criteria for grouping?
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2965
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by boskid »

Transport lines are in the same group if they are connected in any way. Easiest way to explain that is if you have 2 points on belts, if an item can go from first to the second only using belts then those points are in the same group. Special exception is made for splitters as they are connecting all 8 transport lines (4 input and 4 output) into single group.

Sometimes by interacting with belts it may happen that group contains not connected components (as in the graph) and the group can be split, but checking for possible split takes some tiny amount of time.
orzelek
Smart Inserter
Smart Inserter
Posts: 3922
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by orzelek »

Thanks.
So for best performance we should not build huge interconnected webs of belts. I guess with main bus and train deliveris it won't get so bad and any entity like loader will also break the lines.
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2370
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by Jap2.0 »

Interesting, if done correctly this could be a good reason to avoid using balancers.
There are 10 types of people: those who get this joke and those who don't.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2965
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by boskid »

Yes, only belts (+undergrounds) and splitters are grouping, inserters and loaders are not forcing anything to group (loader has 2 transport lines but they connect only from 1 side). It may even happen that both transport lines going through a single belt may belong to 2 separate groups. I would suggest not worrying too much about it as almost every save file i was testing had enough groups to make them benefit from threaded update. Save file in this topic is an exception because there is almost half of the map covered with belts that are interconnected using splitters for filtering and balancing purposes.
zer0t
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon Nov 23, 2020 10:17 pm
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by zer0t »

Kinda sad news for my save, but as long as this save is only one unique specific edge case I completely understand your decision. Guess I will have to stick to 1.0.0 or change my belts.
Thanks for the fast response!
User avatar
Illiou
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Wed Feb 27, 2019 9:35 pm
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by Illiou »

boskid wrote: Tue Nov 24, 2020 1:08 am Thanks for the report. Issue is now fixed for the next release.

Due to multithreaded update, transport lines have to be grouped. In your save file there is at least one huge group that contains 200k+ transport lines and any changes around it (adding or removing belts, splitter, rotating them etc..) will be causing lag spikes when that group is checked for possible split. Issue was that those groups were also being checked periodically in some other unnecesary cases. This save file will not benefit from multithreaded update because of that one huge group. To remove all the remaining lag spikes (when interacting with belts) i would have to disable the whole groupping logic and i will not sacrifice that just because of one extremally unfortunate save file.
I mean, even though this save might be an extreme case, having one main bus with everything connected via splitters is more of a default rather than an edge case... So technically any such (common) save would have this problem as the scale grows.
orzelek
Smart Inserter
Smart Inserter
Posts: 3922
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by orzelek »

Illiou wrote: Tue Nov 24, 2020 7:10 pm
boskid wrote: Tue Nov 24, 2020 1:08 am Thanks for the report. Issue is now fixed for the next release.

Due to multithreaded update, transport lines have to be grouped. In your save file there is at least one huge group that contains 200k+ transport lines and any changes around it (adding or removing belts, splitter, rotating them etc..) will be causing lag spikes when that group is checked for possible split. Issue was that those groups were also being checked periodically in some other unnecesary cases. This save file will not benefit from multithreaded update because of that one huge group. To remove all the remaining lag spikes (when interacting with belts) i would have to disable the whole groupping logic and i will not sacrifice that just because of one extremally unfortunate save file.
I mean, even though this save might be an extreme case, having one main bus with everything connected via splitters is more of a default rather than an edge case... So technically any such (common) save would have this problem as the scale grows.
I guess it should be able to "break up" groups on one belt. I guess that leads to other.. annoying issues since that one belt could get updated out of order and lead to strange behavior.
Tbh it's hard for me to imagine buss that has one interconnected setup with 200k+ transport lines. Have to load the save and check it out :D
Rseding91
Factorio Staff
Factorio Staff
Posts: 14249
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by Rseding91 »

orzelek wrote: Tue Nov 24, 2020 7:15 pm Tbh it's hard for me to imagine buss that has one interconnected setup with 200k+ transport lines. Have to load the save and check it out :D
Imagine a giant pyramid of splitters all merging into one place then splitting off again. that's what it is :P
If you want to get ahold of me I'm almost always on Discord.
orzelek
Smart Inserter
Smart Inserter
Posts: 3922
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by orzelek »

Rseding91 wrote: Tue Nov 24, 2020 7:23 pm
orzelek wrote: Tue Nov 24, 2020 7:15 pm Tbh it's hard for me to imagine buss that has one interconnected setup with 200k+ transport lines. Have to load the save and check it out :D
Imagine a giant pyramid of splitters all merging into one place then splitting off again. that's what it is :P
Save file was removed so I'll need to only imagine that one :)
It's a developers curiosity.. something like "oh carp how did they do that we had no idea it could be used like this".
robot256
Filter Inserter
Filter Inserter
Posts: 874
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by robot256 »

Illiou wrote: Tue Nov 24, 2020 7:10 pm I mean, even though this save might be an extreme case, having one main bus with everything connected via splitters is more of a default rather than an edge case... So technically any such (common) save would have this problem as the scale grows.
All I see is a new mechanic for the UPS optimizers to exploit! Or it will make miniloaders mandatory so you can make "bus buffers" with a line of loaders into chests and back out again.
zer0t
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon Nov 23, 2020 10:17 pm
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by zer0t »

Argh sry thought there is no need anymore for the link. new link: https://nx7119.your-storageshare.de/s/KC6CWJfgK6wyqTS
Rseding91 wrote: Tue Nov 24, 2020 7:23 pm Imagine a giant pyramid of splitters all merging into one place then splitting off again. that's what it is :P
:D you forgot the endless numbers of intersections ;)
Basically I'm distributing all "base" products in a giant matrix and at the end I store anything not need right now in chests.
AartBluestoke
Inserter
Inserter
Posts: 36
Joined: Sun Jun 29, 2014 4:50 am
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by AartBluestoke »

I would suggest use miniloaders: miniloader->chest->miniloader should break the belt chain into segments (eg:https://mods.factorio.com/mod/miniloader) you would just need to put an 'inline buffer' for all belts in a parallel bus to cut the segment at that point.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by eradicator »

Interesting. Sounds overall like loader+wide-chest+loader balancers are now vastly better for performance, and huge spaghetti[Edit: sushi] spirals start lag spikes on every interaction?
Last edited by eradicator on Thu Nov 26, 2020 8:28 am, edited 1 time in total.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2370
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by Jap2.0 »

eradicator wrote: Wed Nov 25, 2020 11:11 am huge spaghetti spirals start lag spikes on every interaction?
I don't know, sounds more like a problem for lasagna people. I like my spaghetti in separate strands.
There are 10 types of people: those who get this joke and those who don't.
TheRaph
Fast Inserter
Fast Inserter
Posts: 232
Joined: Sun Sep 24, 2017 6:31 pm
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by TheRaph »

boskid wrote: Tue Nov 24, 2020 1:08 am To remove all the remaining lag spikes (when interacting with belts) i would have to disable the whole groupping logic and i will not sacrifice that just because of one extremally unfortunate save file.

Would it be possible to make it an option in "settings"?
So one who have such corner-case base could disable belt-multi-shredding so no check for grouping is necessary.

I think in Factorio should be a good game for everyone ... independent of his/her playstyle.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2965
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by boskid »

TheRaph wrote: Wed Nov 25, 2020 8:22 pm Would it be possible to make it an option in "settings"?
No. It would have to be an option that would be part of the game state and shared between all the players and i am not going to duplicate all the tests only to check belts when this logic is turned on and off. If you would have a fluid system with 200k fluid boxes then removing pipe may also lag because it is also doing checks for possible fluid system split. There are no options for fluid and noone is complaining. Only part that i could do is find more cases that are obvious to not cause any group splits, like when placing new belts (for which currently there is a check for possible split).
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [boskid][1.1.0] Belt performance regression

Post by eradicator »

Jap2.0 wrote: Wed Nov 25, 2020 7:45 pm
eradicator wrote: Wed Nov 25, 2020 11:11 am huge spaghetti spirals start lag spikes on every interaction?
I don't know, sounds more like a problem for lasagna people. I like my spaghetti in separate strands.
Eh, i meant to say sushi, not sphagetti. Like this where everything is one humongous spiral.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Post Reply

Return to “Resolved Problems and Bugs”