Affects Version/s: Minecraft 1.13, Minecraft 1.13.1
Fix Version/s: Minecraft 18w30b
ThreadedAnvilChunkStorage overuses synchronization, resulting in massive performance drops to the server.
Because most of the methods are synchronized, the File IO Thread writing a chunk out is done under a synchronized context, blocking the entire class.
The main thread then will hit this class to load chunks, save chunks, check if chunks exists, etc, and will be blocked while any asynchronous chunk saving is occurring.
This totally defeats the entire purpose of having asynchronous IO, and drastically impacts performance.
Please see my patch (licensed MIT, or WTFPL if that makes it even easier legally) for my improvements to the Chunk Save process that has worked fine for us for years: https://github.com/PaperMC/Paper/blob/ffd9c779233fb6e5bb428d865e87c4f3d46607e0/Spigot-Server-Patches/0062-Chunk-save-queue-improvements.patch