[2.0.72] Performance issues when mods add many unit prototypes
Posted: Fri Oct 31, 2025 7:23 pm
Hello. I've noticed that mods which add new unit types have a disproportionate impact on performance, seemingly becoming an issue when spawners first become capable of spawning that unit. This issue is prevalent in Schall Endgame Evolution, which adds 12 new tiers of biter and spitters, and this mod can be a performance hog once higher tier biters start to spawn.
It's not clear to me if this performance issue can be fixed by an engine update, but given that vanilla Factorio only adds a handful of new entities, it's possible that the spawning algorithm used by the game doesn't scale very well when new unit types are added. If this is not the case, some advice on how a mod could be written to improve performance while preserving the challenge of Schall Endgame Evolution would be appreciated.
1. Open the attached save with all mods in the save enabled.
Checking performance, you will see that units consume 9-12 ms of CPU time per update. 2. Open the attached save again, but disable "Schall Endgame Evolution" and "Schall Endgame Evolution tweaks."
Checking performance again, you will see that units consume much less UPS than before, initially only 0.1 ms per update, but rising to 3.5-4.5 ms before reaching what appears to be a steady state.
It's not clear to me if this performance issue can be fixed by an engine update, but given that vanilla Factorio only adds a handful of new entities, it's possible that the spawning algorithm used by the game doesn't scale very well when new unit types are added. If this is not the case, some advice on how a mod could be written to improve performance while preserving the challenge of Schall Endgame Evolution would be appreciated.
1. Open the attached save with all mods in the save enabled.
Checking performance, you will see that units consume 9-12 ms of CPU time per update. 2. Open the attached save again, but disable "Schall Endgame Evolution" and "Schall Endgame Evolution tweaks."
Checking performance again, you will see that units consume much less UPS than before, initially only 0.1 ms per update, but rising to 3.5-4.5 ms before reaching what appears to be a steady state.