What is lua garbage incremental?

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
YunoAloe
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Tue Mar 12, 2019 9:22 pm
Contact:

What is lua garbage incremental?

Post by YunoAloe »

What is lua garbage incremental, why can it be high (1-2 or more) and what do I do to make it lower? I couldn't find any descriptions of it's practical meaning for Factorio, and general Lua GC explanations are too heavy. Does this show overall mod script execution overhead and I should deactivate some mods (AAI in the first place)?

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

Re: What is lua garbage incremental?

Post by Rseding91 »

It's the amount of time spent running Lua garbage collection. Higher times mean mods are making more garbage (being wasteful in what they do).
If you want to get ahold of me I'm almost always on Discord.

OjRacer
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Jan 09, 2019 5:12 pm
Contact:

Re: What is lua garbage incremental?

Post by OjRacer »

Is there any way to get a breakdown of which mods are causing high Lua garbage collection times?

YunoAloe
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Tue Mar 12, 2019 9:22 pm
Contact:

Re: What is lua garbage incremental?

Post by YunoAloe »

I tried the reduce-mods-by-half method to see if any particular mods would be significant consumers of this, but found that while there are some variations indeed, there is no mod that "consumes GC noticeably enough to be worth disabling". Did this a couple of months ago, most difference from 1 mod was 100ms or lower (Factorissimo? AAI? not sure), I think. The overall quantity of mods does influence this a lot though, I have a lot of mods.
Last edited by YunoAloe on Tue Oct 15, 2019 9:16 pm, edited 1 time in total.

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

Re: What is lua garbage incremental?

Post by Rseding91 »

Garbage in mods is caused by one or more of the following:

* Subscribing to events they don't actually need to subscribe to

* Creating tables and then throwing them away/overwriting them

* Creating strings/re-creating strings/concatinating strings/overwriting strings (basically doing anything with strings)

* Inserting/removing from tables

* Not caching the result of Lua API calls (game.player.position.x, game.player.position.y) that reads player twice and position twice and throws both away. It should read player once and position once then store the position in a local and read x/y off that.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Technical Help”