From 0021b114def5d6fe380df3fa32780efdaa634fe1 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 24 May 2020 23:24:27 +0100 Subject: [PATCH] Revert "Slow down queue a bit because 1.13+ performance is bad" This reverts commit bbde2f5e069379a6bb09cca70747dcc7d3c88c4f. --- .../com/plotsquared/core/configuration/Settings.java | 4 ++-- .../com/plotsquared/core/queue/GlobalBlockQueue.java | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java index 2be87ada3..3fbd71394 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java @@ -491,9 +491,9 @@ public class Settings extends Config { @Comment("Settings relating to PlotSquared's GlobalBlockQueue") public static final class QUEUE { - @Comment({"Average time per tick spent completing chunk tasks in ms.", + @Comment({"Average time per tick spent completing chunk tasks in ms. Target average TPS = 20 * 50 / TARGET_TIME.", "Waits (chunk task time / target_time) ticks before completely the next task."}) - public static int TARGET_TIME = 40; + public static int TARGET_TIME = 65; } diff --git a/Core/src/main/java/com/plotsquared/core/queue/GlobalBlockQueue.java b/Core/src/main/java/com/plotsquared/core/queue/GlobalBlockQueue.java index 6abfea8f8..3b63a94c0 100644 --- a/Core/src/main/java/com/plotsquared/core/queue/GlobalBlockQueue.java +++ b/Core/src/main/java/com/plotsquared/core/queue/GlobalBlockQueue.java @@ -57,7 +57,6 @@ public class GlobalBlockQueue { private final RunnableVal2 SET_TASK = new RunnableVal2() { @Override public void run(Long free, LocalBlockQueue queue) { - long t1 = System.currentTimeMillis(); do { boolean more = queue.next(); if (!more) { @@ -67,9 +66,9 @@ public class GlobalBlockQueue { } return; } - } while (((GlobalBlockQueue.this.secondLast = System.currentTimeMillis()) - - GlobalBlockQueue.this.last) < free); - lastPeriod = System.currentTimeMillis() - t1; + } while ((lastPeriod = + ((GlobalBlockQueue.this.secondLast = System.currentTimeMillis()) + - GlobalBlockQueue.this.last)) < free); } }; @@ -125,8 +124,8 @@ public class GlobalBlockQueue { lastPeriod -= targetTime; return; } - SET_TASK.value1 = 30 + Math.min( - (30 + GlobalBlockQueue.this.last) - (GlobalBlockQueue.this.last = + SET_TASK.value1 = 50 + Math.min( + (50 + GlobalBlockQueue.this.last) - (GlobalBlockQueue.this.last = System.currentTimeMillis()), GlobalBlockQueue.this.secondLast - System.currentTimeMillis()); SET_TASK.value2 = GlobalBlockQueue.this.getNextQueue();