Closed Thalassicus closed 10 years ago
I think I managed to solve this.
The problem is Lua copies code to every file that uses it. As a result, every version of YieldLibrary runs duplicate copies of the "reset yield cache" functions. I introduced a small time window to prevent dozens of resets occurring all at once. This reduced the start-turn delays from 16.8 seconds to 3.1 seconds in my tests.
Identify and solve the cause of the 10-20 second freeze at the start of each turn, getting longer by late game.