RelativityMC / C2ME-fabric

A Fabric mod designed to improve the chunk performance of Minecraft.
MIT License
513 stars 42 forks source link

[Feature Request]: Save persistant states asynchronously in auto-save #304

Open Timongcraft opened 2 months ago

Timongcraft commented 2 months ago

Is your feature request related to a problem? Please describe. When the auto-save is performed the persistent states (command storages used in /data ... storage) are saved which can cause significant lag when used heavily.

Describe the solution you'd like It would like it to be saved asyncronously when performed in the auto-save so it won't lag out the server.

Describe alternatives you've considered

Additional context I'm talking about the ServerWorld#saveLevel method which saves the persistant states synchronously. This doesn't occour in paper due to their IO rewrite.(https://github.com/PaperMC/Paper/blob/f4c7d373e4a1aff23539fe099745bf29a28559b9/patches/server/0999-Write-SavedData-IO-async.patch#L79) With the [ioSystem].replaceImpl you can't see this in spark reports but it still lags.

PringlePot commented 1 week ago

This would be great, since for some reason this lags my server a bunch (more than 5seconds for a single tick)