Page 1 of 1

Optimizing factory cpu usage

Posted: Fri May 05, 2017 7:30 am
by burner
My problem is now that I need run my factory with game speed 0.3 to prevent lag. There is not much powerful cpu at shop so I need do something. So questions to someone who know better how game engine works.

- Accumulators. Do it calculate them as one group so that it does not make big difference how much I have them. Or do I blow up my accumulator field?
- Solar panels. Same thing that above. Do I blow my farm or is it just meaningless anyway?
- Robots vs belts at cpu usage. Is there any kind thumb of rules that in which cases is more optimal to use belts and where bots are more cpu friendly?
- Tanks. I have quite lot of tanks can it be problem?
- Other low hanging fruits to optimize factory? I already run all my assembly machines with productivity module 3 so that it hopefully decrease need of inserters and belts & add idle time for calculation. But example is there difference between stack inserters and fast inserters at cpu need? Any ideas are welcome :)

Re: Optimizing factory cpu usage

Posted: Fri May 05, 2017 9:19 am
by quinor
Accus and solar panels are very well optimized. Bots are OK. Belts are not. Remove all belts for performance and it should be ok :)

Re: Optimizing factory cpu usage

Posted: Fri May 05, 2017 10:41 am
by aka13
burner wrote:My problem is now that I need run my factory with game speed 0.3 to prevent lag. There is not much powerful cpu at shop so I need do something. So questions to someone who know better how game engine works.

- Accumulators. Do it calculate them as one group so that it does not make big difference how much I have them. Or do I blow up my accumulator field?
- Solar panels. Same thing that above. Do I blow my farm or is it just meaningless anyway?
- Robots vs belts at cpu usage. Is there any kind thumb of rules that in which cases is more optimal to use belts and where bots are more cpu friendly?
- Tanks. I have quite lot of tanks can it be problem?
- Other low hanging fruits to optimize factory? I already run all my assembly machines with productivity module 3 so that it hopefully decrease need of inserters and belts & add idle time for calculation. But example is there difference between stack inserters and fast inserters at cpu need? Any ideas are welcome :)
Solars/Accus don't matter, 1 or 1 000 000, they are calculated the same way. They should not impact the UPS at all.
Robots vs Belts - Robots are way less performance taxing than belts. Don't know how it will change with 0.16 - Major belt optimisation should happen.
The rest, I don't know, honestly.

Re: Optimizing factory cpu usage

Posted: Fri May 05, 2017 10:50 am
by burner
About bots vs belts, is it always so that bots are better or is there any "sweet spot" so that example when blue belt running at full capacity it will provide better cpu vs transport capacity than bots?

Re: Optimizing factory cpu usage

Posted: Fri May 05, 2017 12:30 pm
by aka13
burner wrote:About bots vs belts, is it always so that bots are better or is there any "sweet spot" so that example when blue belt running at full capacity it will provide better cpu vs transport capacity than bots?
I am not quite sure, but as far as I remember, there is only the question of how many logistic chests you have, the number of bots does not matter at all, I think.

Re: Optimizing factory cpu usage

Posted: Fri May 05, 2017 1:17 pm
by aaargha
As you are using productivity modules I assume you're also using speed beacons to reduce the number of assemblers?

Re: Optimizing factory cpu usage

Posted: Fri May 05, 2017 1:28 pm
by burner
aaargha wrote:As you are using productivity modules I assume you're also using speed beacons to reduce the number of assemblers?
No, I dont. One beacon cannot double output. I am not sure but I have suspicion that it is more cpu efficient make 2 factory than boost one factory with 6 beacon. Someone correct if I am wrong.

aka13 wrote:
burner wrote:About bots vs belts, is it always so that bots are better or is there any "sweet spot" so that example when blue belt running at full capacity it will provide better cpu vs transport capacity than bots?
I am not quite sure, but as far as I remember, there is only the question of how many logistic chests you have, the number of bots does not matter at all, I think.
I think number of bots must affect. Each bot needs constant route calculation and moving from place to another. Anyway I dont know how much it will affect. Some how it feels that count of bots on fly will be more significant than idle chests. But again I am not export and I dont want shoot down any theory if someone have read code or test that.

Re: Optimizing factory cpu usage

Posted: Fri May 05, 2017 2:20 pm
by aaargha
burner wrote:No, I dont. One beacon cannot double output. I am not sure but I have suspicion that it is more cpu efficient make 2 factory than boost one factory with 6 beacon. Someone correct if I am wrong.
Assembler 3 no mods/no beacons craft speed: 1.25
Assembler 3 prod3 mods/no beacons craft speed: 0.5
Assembler 3 prod3 mods/8 speed 3 beacons craft speed: 5.5
Using prod3 modules a beaconed assembler is more than 10x faster.
Most common large scale beacon setups seem to gravitate toward 8 beacons per assembler and 8 assemblers per beacon with a few extra beacons at the edges to keep 8 beacons per assembler.
AFAIK beacons are basically free CPU wise, and one beaconed assembler does not only replace 10 assemblers but also at least 20 inserters and about 20 chests/belts. The savings in CPU usage are really big.

Re: Optimizing factory cpu usage

Posted: Sat May 06, 2017 7:05 am
by burner
aaargha wrote:
burner wrote:No, I dont. One beacon cannot double output. I am not sure but I have suspicion that it is more cpu efficient make 2 factory than boost one factory with 6 beacon. Someone correct if I am wrong.
Assembler 3 no mods/no beacons craft speed: 1.25
Assembler 3 prod3 mods/no beacons craft speed: 0.5
Assembler 3 prod3 mods/8 speed 3 beacons craft speed: 5.5
Using prod3 modules a beaconed assembler is more than 10x faster.
Most common large scale beacon setups seem to gravitate toward 8 beacons per assembler and 8 assemblers per beacon with a few extra beacons at the edges to keep 8 beacons per assembler.
AFAIK beacons are basically free CPU wise, and one beaconed assembler does not only replace 10 assemblers but also at least 20 inserters and about 20 chests/belts. The savings in CPU usage are really big.
You probably are right. At least arguments are quite logical :)

More ideas?

Re: Optimizing factory cpu usage

Posted: Sat May 06, 2017 7:14 am
by aka13
burner wrote:
aaargha wrote:As you are using productivity modules I assume you're also using speed beacons to reduce the number of assemblers?
No, I dont. One beacon cannot double output. I am not sure but I have suspicion that it is more cpu efficient make 2 factory than boost one factory with 6 beacon. Someone correct if I am wrong.

aka13 wrote:
burner wrote:About bots vs belts, is it always so that bots are better or is there any "sweet spot" so that example when blue belt running at full capacity it will provide better cpu vs transport capacity than bots?
I am not quite sure, but as far as I remember, there is only the question of how many logistic chests you have, the number of bots does not matter at all, I think.
I think number of bots must affect. Each bot needs constant route calculation and moving from place to another. Anyway I dont know how much it will affect. Some how it feels that count of bots on fly will be more significant than idle chests. But again I am not export and I dont want shoot down any theory if someone have read code or test that.
No no, thats the thing. Bots dont have separate calculations for every bot. The devs explained it somewhere, basically when the bot has a task it does not recalculate anything on the route.

Re: Optimizing factory cpu usage

Posted: Sat May 06, 2017 8:41 am
by aaargha
I believe this may be the thread. Just note that it's a year old so both bots and belts have probably become more optimized since.