From 6b3c0bb3c6fd197d907d97dd8ce695eaeb35dfbc Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Wed, 8 Feb 2017 15:11:43 -0600 Subject: [PATCH] Make chunk unload targetSize more aggressive Re: GH-597 --- ...-Spigot-chunk-unload-rate-throttling.patch | 39 ------------------- ...more-aggressive-in-the-chunk-unload-.patch | 22 +++++++++++ 2 files changed, 22 insertions(+), 39 deletions(-) delete mode 100644 Spigot-Server-Patches/0211-Disable-Spigot-chunk-unload-rate-throttling.patch create mode 100644 Spigot-Server-Patches/0211-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch diff --git a/Spigot-Server-Patches/0211-Disable-Spigot-chunk-unload-rate-throttling.patch b/Spigot-Server-Patches/0211-Disable-Spigot-chunk-unload-rate-throttling.patch deleted file mode 100644 index 2ba45d9c2e..0000000000 --- a/Spigot-Server-Patches/0211-Disable-Spigot-chunk-unload-rate-throttling.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 12cbc9ca5cc3aa13d8daeea8beecf3f8ad47eac7 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Tue, 7 Feb 2017 16:55:35 -0600 -Subject: [PATCH] Disable Spigot chunk unload rate throttling - - -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 7006466b5..695c9bd2a 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -324,7 +324,7 @@ public class ChunkProviderServer implements IChunkProvider { - if (!this.unloadQueue.isEmpty()) { - // Spigot start - org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant; -- activityAccountant.startActivity(0.5); -+ //activityAccountant.startActivity(0.5); // Paper - int targetSize = (int) (this.unloadQueue.size() * UNLOAD_QUEUE_RESIZE_FACTOR); - // Spigot end - -@@ -344,14 +344,14 @@ public class ChunkProviderServer implements IChunkProvider { - // CraftBukkit end - - // Spigot start -- if (this.unloadQueue.size() <= targetSize && activityAccountant.activityTimeIsExhausted()) { -+ if (false && this.unloadQueue.size() <= targetSize && activityAccountant.activityTimeIsExhausted()) { // Paper - Disable for the time being - break; - } - // Spigot end - } - } - -- activityAccountant.endActivity(); // Spigot -+ //activityAccountant.endActivity(); // Spigot // Paper - } - // Paper start - delayed chunk unloads - long now = System.currentTimeMillis(); --- -2.11.1.windows.1 - diff --git a/Spigot-Server-Patches/0211-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch b/Spigot-Server-Patches/0211-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch new file mode 100644 index 0000000000..cd9e9ea54e --- /dev/null +++ b/Spigot-Server-Patches/0211-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch @@ -0,0 +1,22 @@ +From dfc423da6ba14011716914b9def57dbccd9f1352 Mon Sep 17 00:00:00 2001 +From: Brokkonaut +Date: Tue, 7 Feb 2017 16:55:35 -0600 +Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue + + +diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java +index 7006466b5..c32fb3ef5 100644 +--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +@@ -325,7 +325,7 @@ public class ChunkProviderServer implements IChunkProvider { + // Spigot start + org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant; + activityAccountant.startActivity(0.5); +- int targetSize = (int) (this.unloadQueue.size() * UNLOAD_QUEUE_RESIZE_FACTOR); ++ int targetSize = Math.min(this.unloadQueue.size() - 100, (int) (this.unloadQueue.size() * UNLOAD_QUEUE_RESIZE_FACTOR)); // Paper - Make more aggressive + // Spigot end + + Iterator iterator = this.unloadQueue.iterator(); +-- +2.11.1.windows.1 +