Folia/patches/server/0011-Disable-mid-tick-task-execution.patch
Spottedleaf 76b06a1260 Do not call getGameTime when portalling Villagers
The code to stop all brain tasks is required to pass the current
game time to the tasks it stops. But, when a villager is being
portalled, the copied entity does not have any running tasks. So,
we can simply return early before invoking getGameTime if there
are no running tasks.

Fixes https://github.com/PaperMC/Folia/issues/23
2023-03-31 20:48:20 -07:00

24 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Mon, 20 Mar 2023 02:07:43 -0700
Subject: [PATCH] Disable mid-tick task execution
Mid-tick task execution acquires the ticket lock at least,
which can possibly be a significant performance bottleneck
at a high tick thread + region count. This change should reduce
the impact from scaling the region threads, but is not a fix
to the underlying issue.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index f5977082a31d44088ab5ba31fad88e823cfe56e0..f5721f6d719b7055fdccc81d5e67ed758e90cb10 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2909,6 +2909,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public final void executeMidTickTasks() {
+ if (true) return; // Folia - disable mid-tick task execution
org.spigotmc.AsyncCatcher.catchOp("mid tick chunk task execution");
io.papermc.paper.threadedregions.RegionizedWorldData worldData = io.papermc.paper.threadedregions.TickRegionScheduler.getCurrentRegionizedWorldData(); // Folia - region threading
long startTime = System.nanoTime();