[boskid][2.0.28] High CPU time in "Electric Network" after creating and destroying many space platforms
Posted: Sun Dec 22, 2024 5:48 pm
After creating and destroying a large number of space platforms, there is abnormally high CPU usage for "Electric network" despite there no longer being any space platforms. This also increases the size of the save file.
The issue persists across reload and restarting the game. I checked this both on the MacOS build (M2 laptop) and the Windows build.
Steps to reproduce
1. Start a new game
2. Open F4 debug menu and enable "show time usage"
3. Create and destroy a large number of space platforms by running this:
4. Observe that "Electric Network" CPU time usage is seemingly linearly increasing
5. Open editor and observe that there are no surfaces aside from Nauvis
Here's a save file you can open which will have high CPU usage:
The issue persists across reload and restarting the game. I checked this both on the MacOS build (M2 laptop) and the Windows build.
Steps to reproduce
1. Start a new game
2. Open F4 debug menu and enable "show time usage"
3. Create and destroy a large number of space platforms by running this:
Code: Select all
/c
storage.x=0
script.on_nth_tick(1,function()
storage.x=storage.x+1
if storage.x > 100000 then return end
local p = game.forces.player.create_space_platform({name='p'..storage.x,planet='nauvis',starter_pack='space-platform-starter-pack'})
p.apply_starter_pack()
p.destroy(10)
end)
5. Open editor and observe that there are no surfaces aside from Nauvis
Code: Select all
Update: 20.884/17.498/22.520
Latency update: 0
Game update: 20.864/17.466/22.495
Planets update: 0.001/0.000/0.003
Control behaviors (MT): 0.059/0.016/0.184
Transport lines (MT): 0.068/0.024/0.145
Electric+Heat+Fluid+Circuit (MT): 20.714/17.315/22.311
Electric network: 18.488/15.148/20.101
Heat network: O
Fluid flow: 0.000/0.000/0.020
Entity update: 0.004/0.003/0.026
Lightning update: 0
Tile heating update: 0