Page 1 of 1

What is lua garbage incremental?

Posted: Mon May 27, 2019 11:49 pm
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)?

Re: What is lua garbage incremental?

Posted: Tue May 28, 2019 4:57 am
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).

Re: What is lua garbage incremental?

Posted: Tue Oct 15, 2019 12:01 pm
by OjRacer
Is there any way to get a breakdown of which mods are causing high Lua garbage collection times?

Re: What is lua garbage incremental?

Posted: Tue Oct 15, 2019 12:23 pm
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.

Re: What is lua garbage incremental?

Posted: Tue Oct 15, 2019 8:31 pm
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.