How to figure out what part of my factory impairs performance?

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
luc
Fast Inserter
Fast Inserter
Posts: 218
Joined: Sun Jul 17, 2016 9:53 pm
Contact:

How to figure out what part of my factory impairs performance?

Post by luc »

I've been making a pretty large map (well, for my own standards) and while 0.16 was a great improvement (or was it .15? I've been playing this map too long to remember), I'm at a point again where performance matters. When everything is idle, I get about 65-70ups performance on a decent laptop. When I turn the factory on (launching rockets and making science), I get about 35-50ups depending on my zoom level and where I stand (more graphics lag (lower FPS) seems to improve UPS).

When looking at debug info, there are 2 239 999 entities, of which 152 573 active when the factory is idle.

I had the great idea of powering down sections selectively, because obviously an object without power cannot do work so it cannot be active right?

After powering down almost everything (not the nuclear installations itself), the number is unchanged and I get maybe 2-5 UPS extra. The active entity count even went up a little, but that is probably random variance.

How can I figure out what parts of the factory cause the performance drag?

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: How to figure out what part of my factory impairs performance?

Post by Optera »

A year ago Rseding said following in this thread:
Rseding91 wrote:"Powering down" things is one of the worse ways you can stop a factory. Simply not giving it any resources to consume/use is the ideal way.

The problem is: "powering down" an entity means the normal update logic on the entity can't run because there's no power to do things like "move the inserter arm". The entity has no update notification when power is restored so it can't disable itself.
Since then I'm using an RS latch with delayed off logic which seems to work for me.
It first turns off material flow to the section i want to power down, waits until all material has been processed and only then shuts off power.

luc
Fast Inserter
Fast Inserter
Posts: 218
Joined: Sun Jul 17, 2016 9:53 pm
Contact:

Re: How to figure out what part of my factory impairs performance?

Post by luc »

What if resources are available but not flowing through, since the factory is completely idle? Does that still keep entities active? I'd guess so, since they have to keep checking whether their target accepts new input, but maybe it works the other way around (the target triggering the inserter).

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: How to figure out what part of my factory impairs performance?

Post by Optera »

As far as inserters go they should enter a sleep mode when there's nothing to do.
For example a completely empty belt. Any item passing them will wake them up though.

luc
Fast Inserter
Fast Inserter
Posts: 218
Joined: Sun Jul 17, 2016 9:53 pm
Contact:

Re: How to figure out what part of my factory impairs performance?

Post by luc »

Also if the item is just laying there and not moving?

And is there any way I could find this / figure this out by myself? I'm fine just asking questions here, but then someone needs to keep spending time on writing answers :P

Rseding91
Factorio Staff
Factorio Staff
Posts: 13174
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: How to figure out what part of my factory impairs performance?

Post by Rseding91 »

luc wrote:Also if the item is just laying there and not moving?

And is there any way I could find this / figure this out by myself? I'm fine just asking questions here, but then someone needs to keep spending time on writing answers :P
Press F4 and enable "show active state".

If the machine has nothing to do it's disabled. There's no "this part of the factory takes more CPU time than this one" - every entity of a given type takes the same amount of CPU time as the rest. It's all about the number of them you've built.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Technical Help”