Question: What is more CPU-safeing? (How to control a whole block of machines most CPU-efficient)

Post all other topics which do not belong to any other category.
Post Reply
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Question: What is more CPU-safeing? (How to control a whole block of machines most CPU-efficient)

Post by ssilk »

Following situation: You have a smelter-block (or any other specialized factory-part), which consists out of (lets say) 1000 smelters, 2000 inserters, many many belts, splitters etc. (just to see the difference in CPU-usage)
When it is fully operational, you can see that on the CPU-load. But when enough is smelted, the belts and smelters are full, does it really take no CPU anymore? In my opinion not: Especially if the block is only at 5 or 15 % usage. Because the inserters need to look, if they can insert something on the full belts.

What takes least CPU-cycles? If you control the operation of the whole block by ...
- ... doing nothing: When enough smelted, the system stops itself, because the belts and smelters are full. (see above)
- ... one power-switch to control it all: When you have enough material smelted, turn the whole block completly off. This has also the advantage, that you spare the whole standby-power.
- ... the incoming belts by signals: When enough material smelted stop the incoming belts so that the remains on the belts are smelted, but after a minute or so the complete block is empty, no item on belts anymore.
- ... the inserting inserters (into the smelters): When enough smelted, stop the inserters by wires, so that the outgoing belts are cleared after some seconds.
- ... [insert your idea]
- ... a mixture of the above techiques: When enough smelted, stop incoming belts, and when all belts are cleared turn the power off.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Loewchen
Global Moderator
Global Moderator
Posts: 8301
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Question: What is more CPU-safeing? (How to control a whole block of machines most CPU-efficient)

Post by Loewchen »

Doing nothing should be best I think. Cutting power is general bad because stuff without power does not sleep, deactivating belts or inserters has no advantage over doing nothing, it just creates a different reason to sleep/wake up and instead of doing nothing costs computation additionally.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Question: What is more CPU-safeing? (How to control a whole block of machines most CPU-efficient)

Post by DaveMcW »

Furnaces, inserters, and belts are optimized to use no CPU when they are empty or full.

Power switches and circuit networks ALWAYS use CPU.

mmmPI
Smart Inserter
Smart Inserter
Posts: 2728
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Question: What is more CPU-safeing? (How to control a whole block of machines most CPU-efficient)

Post by mmmPI »

Loewchen wrote:
Sat Jul 20, 2019 4:55 pm
Doing nothing should be best I think. Cutting power is general bad because stuff without power does not sleep, deactivating belts or inserters has no advantage over doing nothing, it just creates a different reason to sleep/wake up and instead of doing nothing costs computation additionally.
I do understand that the question is originally about the CPU, but if you were to have a very bad laptop your CPU can help the poor integrated GPU and in this case for perfomances having less items on screen/moving would help right ? That's my impression from monitoring the temperature during very hot summer :|

Temperature increases when i unzoom, and it caps at a higher temperature when i'm near lots of items. Not sure how it compares between drawing the empty belts vs drawing them full of stopped item, but my expectations are that the empty belt animation is less costly.

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Question: What is more CPU-safeing? (How to control a whole block of machines most CPU-efficient)

Post by quyxkh »

I haven't done exhaustive testing, but I've done some and been in threads with others doing it. I think the most efficient thing to do is shut off the supplies, drain the buffers and wait for everything to go idle, _then_ shut off the power. One I remember was inserters, the CPU load when they're active was like 15x what it was if you let them all go idle; once you do if you shut off the power you cut the cpu load in half again. Also, beacons: setting up a monster beacon drain and accumulator bank that can power them, charging the bank off a 1?GW nuc supply that was about half enough to run the beacons itself and running an SR latch on a power switch so the beacons cycle the bank between 5 and 95, again, the way I remember it is the CPU load dropped noticeably when the beacons were powered off.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Question: What is more CPU-safeing? (How to control a whole block of machines most CPU-efficient)

Post by ssilk »

quyxkh wrote:
Sun Jul 21, 2019 1:43 pm
I haven't done exhaustive testing, but I've done some and been in threads with others doing it. I think the most efficient thing to do is shut off the supplies, drain the buffers and wait for everything to go idle, _then_ shut off the power. One I remember was inserters, the CPU load when they're active was like 15x what it was if you let them all go idle; once you do if you shut off the power you cut the cpu load in half again. Also, beacons: setting up a monster beacon drain and accumulator bank that can power them, charging the bank off a 1?GW nuc supply that was about half enough to run the beacons itself and running an SR latch on a power switch so the beacons cycle the bank between 5 and 95, again, the way I remember it is the CPU load dropped noticeably when the beacons were powered off.
Thank you, that was my assumption.
What I did now was for furnaces for example, that I installed a timer, which triggers the output inserters once every 5 seconds so the inseters move much less
I also count the time when the last item was going into the block and assume, that it takes maximum 20 seconds. After that the whole block is turned off.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Question: What is more CPU-safeing? (How to control a whole block of machines most CPU-efficient)

Post by quyxkh »

ssilk wrote:
Sun Jul 21, 2019 10:10 pm
quyxkh wrote:
Sun Jul 21, 2019 1:43 pm
I haven't done exhaustive testing, but I've done some and been in threads with others doing it. I think the most efficient thing to do is shut off the supplies, drain the buffers and wait for everything to go idle, _then_ shut off the power. One I remember was inserters, the CPU load when they're active was like 15x what it was if you let them all go idle; once you do if you shut off the power you cut the cpu load in half again. Also, beacons: setting up a monster beacon drain and accumulator bank that can power them, charging the bank off a 1?GW nuc supply that was about half enough to run the beacons itself and running an SR latch on a power switch so the beacons cycle the bank between 5 and 95, again, the way I remember it is the CPU load dropped noticeably when the beacons were powered off.
Thank you, that was my assumption.
What I did now was for furnaces for example, that I installed a timer, which triggers the output inserters once every 5 seconds so the inseters move much less
I also count the time when the last item was going into the block and assume, that it takes maximum 20 seconds. After that the whole block is turned off.
For that you can even math it out, smelter efficiency I've spent time on. Work out your output rate in ticks per handful so you get the full 12 or whatever you're up to, there's going to be some base somewhere in my future where I'm organized enough to run a "current interesting numbers" bus, for instance my boosted smelter cells could do 12 plates per just-over-209 ticks a while ago, so I had the inserters on a 209-tick clock.

There's a cost for holding inserters active with circuitry, unless something's changed dramatically the circuit-controlled buffering only pays off for boosted iron and copper plates, but steel is produced five times slower and the cost of holding the inserters active that long winds up a small net loss, 7% higher total production+delivery cost in one design I recall. For boosted iron/copper smelting, though, clocking pays big.

Another big win you can get with circuitry is for robots, control the counts so all the active requests are for a particular set of short-run deliveries, then all the bots will do those until your circuitry switches them to the next set. Watching robots focus in on just one job, doing countless deliveries per charge instead of them all running all over the pod doing one here, the next one way over there, is amazing.

edit: oh, yeah: for stuff like this where you've got hundreds or thousands of connections to a circuit, signal efficiency pays. Don't run the entire clock cycle out to the inserters so every one of them has to check every change, send just one clean "activate" pulse on the main wire, entities only check circuit conditions when the signal on the wire changes. DaveMcW noticed how important that one was, no surprise there.

Post Reply

Return to “General discussion”