From 736cc927ff5f546077b6bfb1220070150aefe741 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 3 Oct 2017 13:16:30 +0100 Subject: [PATCH] Enable chunk caching by default the footprint of compressed chunk batches is so small now that it doesn't make sense to disable it out of the box. The performance gains from caching chunks are more than worth it. As of 1.2, the average footprint of these caches is usually ~2% or less of the size of the actual chunk itself. Moving around a lot will frequently cause the same chunks to get sent several times as it passes in and out of your render distance, and the chunk isn't even changing in that time, so the chunk is getting needlessly re-serialized over and over again. So even if your world is not static (for example a creative server) chunk caching will still offer benefits, and the memory expense is so small it's a no-brainer. --- src/pocketmine/level/Level.php | 2 +- src/pocketmine/resources/pocketmine.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index b08841567..566d376ff 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -337,7 +337,7 @@ class Level implements ChunkManager, Metadatable{ $this->chunkGenerationQueueSize = (int) $this->server->getProperty("chunk-generation.queue-size", 8); $this->chunkPopulationQueueSize = (int) $this->server->getProperty("chunk-generation.population-queue-size", 2); $this->clearChunksOnTick = (bool) $this->server->getProperty("chunk-ticking.clear-tick-list", true); - $this->cacheChunks = (bool) $this->server->getProperty("chunk-sending.cache-chunks", false); + $this->cacheChunks = (bool) $this->server->getProperty("chunk-sending.cache-chunks", true); $dontTickBlocks = $this->server->getProperty("chunk-ticking.disable-block-ticking", []); $this->randomTickBlocks = new \SplFixedArray(256); diff --git a/src/pocketmine/resources/pocketmine.yml b/src/pocketmine/resources/pocketmine.yml index 2295ec732..14f285c0b 100644 --- a/src/pocketmine/resources/pocketmine.yml +++ b/src/pocketmine/resources/pocketmine.yml @@ -132,7 +132,7 @@ chunk-sending: spawn-radius: 4 #Save a serialized copy of the chunk in memory for faster sending #Useful in mostly-static worlds where lots of players join at the same time - cache-chunks: false + cache-chunks: true chunk-ticking: #Max amount of chunks processed each tick