Bottleneck

by trold

A tool for locating input starved machines.

Utilities
18 days ago
0.13 - 2.0
254K

g Great Mod, Tanks Performance.

8 years ago

Used this mod from the start of my game so it took me a while to pin the source of the lag.
great for factories until you exceed the 1k machines mark. ive got around 3k machines with the bottleneck lights and my ups was down to about 25.

Really great mod and ill toggle it back on from time to time to check how my factory runs but it cant be used all the time, otherwise great work its a really great idea. :)

8 years ago

I think it should be possible to have the toggle button stop updating all the entities. When the hotkey is pressed to toggle it off, set them all to invisible and don't run on_tick() until it's toggled back on.

8 years ago

Just tried this, now takes basically nothing to run when toggled off. No idea if it'll introduce any weird bugs, use at your own risk.

https://gist.github.com/anonymous/6ee73c855cfab230e1ddbaf8bdcd4a8c
Replace control.lua with the linked version.

8 years ago

t4nk3r4lyf: The old version of the mod used to update all machines, but since v0.2.0, the mod should not tank performance, since it only updates at most 40 machines per tick, no matter how big the factory is. Have you updated to the latest version?

bsdfhsbzxcbz: Great work. There is a small bug in your code, which shows up if an entity has been removed just before we perform the "run once". This is due to iterating by index into the table, which doesn't handle elements being removed from the table. I decided to use your idea of removing all signals in a single tick (but in a separate loop), and then not update until told otherwise. The update should be up shortly.

New response