From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Mon, 27 Apr 2020 02:48:06 -0700 Subject: [PATCH] Reduce MutableInt allocations from light engine diff --git a/src/main/java/net/minecraft/server/LightEngineBlock.java b/src/main/java/net/minecraft/server/LightEngineBlock.java index 93a972605c26aa757b9c915876f847da04fcb496..c4ba30bd56e2ead6015c0109f8e889388afeb7f2 100644 --- a/src/main/java/net/minecraft/server/LightEngineBlock.java +++ b/src/main/java/net/minecraft/server/LightEngineBlock.java @@ -37,7 +37,10 @@ public final class LightEngineBlock extends LightEngineLayer= 15) { @@ -49,6 +52,10 @@ public final class LightEngineBlock extends LightEngineLayer= 15) { return k; } else { - MutableInt mutableint = new MutableInt(); + // Paper start - reduce mutableint allocations + MutableInt mutableint = com.destroystokyo.paper.util.pooled.PooledObjects.POOLED_MUTABLE_INTEGERS.acquire(); + try { + // Paper end - reduce mutableint allocations IBlockData iblockdata = this.a(j, mutableint); if (mutableint.getValue() >= 15) { @@ -85,6 +88,10 @@ public final class LightEngineSky extends LightEngineLayer