So I noticed that trying to save data to the registry started causing noticeable lag spikes (0.5s) whenever I tried to save data to the registry in the middle of gameplay.
After a little investigation this seems to be directly tied to the size of savegame.xml: I had one of more than 50MB when I noticed that lag, I manually removed some saved data from mods that were taking a lot of space and went down to 11MB, which reduced the lag spike a lot to become barely noticeable.
Steps to reproduce the behavior
Fill your savegame.xml with a lot of dummy data to reach 50MB size or more.
Add the following code to the tick() function of a script:
if InputPressed("e") then
local val = GetTime()
DebugPrint("registry set "..val)
SetInt("savegame.mod.tmp", val)
end
Load that script into the game.
Press E a few times and notice the lag spike each time.
Expected behavior
Saving data to the registry remains smooth even when save file becomes huge.
Describe the bug
So I noticed that trying to save data to the registry started causing noticeable lag spikes (0.5s) whenever I tried to save data to the registry in the middle of gameplay. After a little investigation this seems to be directly tied to the size of
savegame.xml
: I had one of more than 50MB when I noticed that lag, I manually removed some saved data from mods that were taking a lot of space and went down to 11MB, which reduced the lag spike a lot to become barely noticeable.Steps to reproduce the behavior
savegame.xml
with a lot of dummy data to reach 50MB size or more.tick()
function of a script:Expected behavior
Saving data to the registry remains smooth even when save file becomes huge.
Environment
Additional context
No response