perf: async autosave for dedicated server

Autosave previously froze the main thread for 2-6 seconds while
compressing the entire save file with zlib. Now the save buffer is
snapshotted under the lock (~18ms), then compression runs on a
background thread. The compressed data is committed to StorageManager
on the next main-thread tick via CommitPendingAsyncSave().

Also skip redundant full chunk saves during autosave on the dedicated
server -- chunks are already persisted by the per-tick trickle save.
Only entity data is flushed, matching Xbox/Orbis behavior.

Added per-step timing to the autosave handler for diagnostics.
This commit is contained in:
itsRevela
2026-03-31 23:33:21 -05:00
parent 450891d8c4
commit 073a511217
6 changed files with 227 additions and 2 deletions

View File

@@ -16,6 +16,7 @@
#include "..\Security\IdentityTokenManager.h"
#include "..\WorldManager.h"
#include "..\Console\ServerCli.h"
#include "..\..\Minecraft.World\ConsoleSaveFileOriginal.h"
#include "Tesselator.h"
#include "Windows64/4JLibs/inc/4J_Render.h"
#include "Windows64/GameConfig/Minecraft.spa.h"
@@ -330,6 +331,7 @@ static void TickCoreSystems()
g_NetworkManager.DoWork();
ProfileManager.Tick();
StorageManager.Tick();
ConsoleSaveFileOriginal::CommitPendingAsyncSave();
}
/**