[0.14.21] Lamps load chunks causing unnecessary lag

Bugs that are actually features.
Post Reply
GeoStyx
Burner Inserter
Burner Inserter
Posts: 18
Joined: Mon Nov 24, 2014 9:40 pm
Contact:

[0.14.21] Lamps load chunks causing unnecessary lag

Post by GeoStyx »

I love lamps. I blueprint them with everything so they are everywhere. I have around 19k of them around the world.
My game update is around 14.5 now. I noticed lamps keep chunks "active" so I tested removing them to see what happens.

After removing all lights with a lua command, Game Update went from ~14.5 -> ~12 and Entity Update went from ~11.3 -> ~8.8


With lamps:
[Complete time used](https://i.imgur.com/7OAuhfm.png)
[Active chunks](https://i.imgur.com/nhusW0r.png)

Without lamps:
[Complete time used](https://i.imgur.com/GDWidd9.png)
[Active chunks](https://i.imgur.com/KY0Iivz.png)

So it seems lamps mark a chunk as "active" making the game take more time to process. It's fine right now for my world, but I plan to double the size so I'm trying to keep things fast. It's sad to me that lights are causing so much game update time :(

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

Re: [0.14.21] Lamps load chunks causing unnecessary lag

Post by Rseding91 »

That's... not a bug.

That's like saying "Inserters cause chunks to be active". Yes, they have to to operate. That's how it works.
If you want to get ahold of me I'm almost always on Discord.

robyoublind
Burner Inserter
Burner Inserter
Posts: 17
Joined: Fri Nov 25, 2016 10:46 am
Contact:

Re: [0.14.21] Lamps load chunks causing unnecessary lag

Post by robyoublind »

In theory though, would it not be possible to optimize this by skipping light updates if 1) all lamps in a chunk are not connected to circuit/logistic network; 2) no players can see them? Like, set a flag on a chunk skipLamps = true and change it if these circumstances change? After all, they have a constant predictable electricity drain, so when looping over chunks you can avoid looping over each lamp in it and just cache their amount in each chunk. Am I missing something?

GeoStyx
Burner Inserter
Burner Inserter
Posts: 18
Joined: Mon Nov 24, 2014 9:40 pm
Contact:

Re: [0.14.21] Lamps load chunks causing unnecessary lag

Post by GeoStyx »

That's what I was thinking. If this could be done it'd really boost performance.
I get what you're saying Rsedding. I'd just think lights are simple/predictable enough to have some kind of caching rather than marking the chunk active like you would for inserters, etc.

But I'm not a dev so maybe it's best to keep it like it is.

Valeskas
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Sep 16, 2016 4:59 pm
Contact:

Re: [0.14.21] Lamps load chunks causing unnecessary lag

Post by Valeskas »

GeoStyx wrote:I love lamps.
Personally, I would expect default lamps to be treated as single entity, similar to solar panels. If that is not the case, maybe create a world covered with lamps, and submit it here Performance optimization - post your saves.

Post Reply

Return to “Not a bug”