From 7e3022e313a35613df6a948c432561510dd17abc Mon Sep 17 00:00:00 2001 From: Taiyou06 Date: Sun, 16 Mar 2025 20:37:49 +0100 Subject: [PATCH] [ci skip] small cleanup --- ...per-id-map-with-optimized-collection.patch | 43 ------------------- ...134-Slightly-optimized-VarInt-write.patch} | 0 ...te-ClientboundLightUpdatePacketData.patch} | 4 ++ ...imizations-on-SerializableChunkData.patch} | 0 ...h => 0137-Rework-ChunkHolderManager.patch} | 0 ....patch => 0138-Optimize-chunkUnload.patch} | 0 ...g.patch => 0139-Async-chunk-sending.patch} | 0 ...atch => 0140-Spawner-Configurations.patch} | 0 8 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 leaf-server/minecraft-patches/features/0134-Replace-IdMapper-id-map-with-optimized-collection.patch rename leaf-server/minecraft-patches/features/{0135-Slightly-optimized-VarInt-write.patch => 0134-Slightly-optimized-VarInt-write.patch} (100%) rename leaf-server/minecraft-patches/features/{0136-Rewrite-ClientboundLightUpdatePacketData.patch => 0135-Rewrite-ClientboundLightUpdatePacketData.patch} (98%) rename leaf-server/minecraft-patches/features/{0137-Some-Optimizations-on-SerializableChunkData.patch => 0136-Some-Optimizations-on-SerializableChunkData.patch} (100%) rename leaf-server/minecraft-patches/features/{0138-Rework-ChunkHolderManager.patch => 0137-Rework-ChunkHolderManager.patch} (100%) rename leaf-server/minecraft-patches/features/{0139-Optimize-chunkUnload.patch => 0138-Optimize-chunkUnload.patch} (100%) rename leaf-server/minecraft-patches/features/{0140-Async-chunk-sending.patch => 0139-Async-chunk-sending.patch} (100%) rename leaf-server/minecraft-patches/features/{0141-Spawner-Configurations.patch => 0140-Spawner-Configurations.patch} (100%) diff --git a/leaf-server/minecraft-patches/features/0134-Replace-IdMapper-id-map-with-optimized-collection.patch b/leaf-server/minecraft-patches/features/0134-Replace-IdMapper-id-map-with-optimized-collection.patch deleted file mode 100644 index b3a16662..00000000 --- a/leaf-server/minecraft-patches/features/0134-Replace-IdMapper-id-map-with-optimized-collection.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Taiyou06 -Date: Mon, 24 Feb 2025 16:33:46 +0100 -Subject: [PATCH] Replace IdMapper id map with optimized collection - - -diff --git a/net/minecraft/core/IdMapper.java b/net/minecraft/core/IdMapper.java -index 439dc29b8ee8a1dc2ec63c00a9727a37bb697bad..be80e0bd9b44f7a04075827f0a8f22a126031c07 100644 ---- a/net/minecraft/core/IdMapper.java -+++ b/net/minecraft/core/IdMapper.java -@@ -11,7 +11,7 @@ import javax.annotation.Nullable; - - public class IdMapper implements IdMap { - private int nextId; -- private final Reference2IntMap tToId; -+ private final it.unimi.dsi.fastutil.objects.Object2IntOpenCustomHashMap tToId; // Leaf - Optimize IdMapper - private final List idToT; - - public IdMapper() { -@@ -20,7 +20,22 @@ public class IdMapper implements IdMap { - - public IdMapper(int expectedSize) { - this.idToT = Lists.newArrayListWithExpectedSize(expectedSize); -- this.tToId = new Reference2IntOpenHashMap<>(expectedSize); -+ // Leaf start - Replace IdMapper id map with optimized collection -+ this.tToId = new it.unimi.dsi.fastutil.objects.Object2IntOpenCustomHashMap<>( -+ expectedSize, -+ new it.unimi.dsi.fastutil.Hash.Strategy<>() { -+ @Override -+ public int hashCode(T o) { -+ return System.identityHashCode(o); -+ } -+ -+ @Override -+ public boolean equals(T a, T b) { -+ return a == b; -+ } -+ } -+ ); -+ // Leaf end - Replace IdMapper id map with optimized collection - this.tToId.defaultReturnValue(-1); - } - diff --git a/leaf-server/minecraft-patches/features/0135-Slightly-optimized-VarInt-write.patch b/leaf-server/minecraft-patches/features/0134-Slightly-optimized-VarInt-write.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0135-Slightly-optimized-VarInt-write.patch rename to leaf-server/minecraft-patches/features/0134-Slightly-optimized-VarInt-write.patch diff --git a/leaf-server/minecraft-patches/features/0136-Rewrite-ClientboundLightUpdatePacketData.patch b/leaf-server/minecraft-patches/features/0135-Rewrite-ClientboundLightUpdatePacketData.patch similarity index 98% rename from leaf-server/minecraft-patches/features/0136-Rewrite-ClientboundLightUpdatePacketData.patch rename to leaf-server/minecraft-patches/features/0135-Rewrite-ClientboundLightUpdatePacketData.patch index 3f869283..0dd12e5e 100644 --- a/leaf-server/minecraft-patches/features/0136-Rewrite-ClientboundLightUpdatePacketData.patch +++ b/leaf-server/minecraft-patches/features/0135-Rewrite-ClientboundLightUpdatePacketData.patch @@ -3,6 +3,10 @@ From: Taiyou06 Date: Mon, 24 Feb 2025 21:33:24 +0100 Subject: [PATCH] Rewrite ClientboundLightUpdatePacketData +On writing operations: +At 256 sections with 0.75 fill ratio: 18x faster (333.489 μs → 18.606 μs) +At 256 sections with 0.5 fill ratio: 13.5x faster (147.804 μs → 10.962 μs) + diff --git a/net/minecraft/network/protocol/game/ClientboundLightUpdatePacketData.java b/net/minecraft/network/protocol/game/ClientboundLightUpdatePacketData.java index a0b54f3a3d11e0f0f1cb806406a870ba36da8f07..234280499fe1bc495bcdd4c3e144d1f99b7e6975 100644 diff --git a/leaf-server/minecraft-patches/features/0137-Some-Optimizations-on-SerializableChunkData.patch b/leaf-server/minecraft-patches/features/0136-Some-Optimizations-on-SerializableChunkData.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0137-Some-Optimizations-on-SerializableChunkData.patch rename to leaf-server/minecraft-patches/features/0136-Some-Optimizations-on-SerializableChunkData.patch diff --git a/leaf-server/minecraft-patches/features/0138-Rework-ChunkHolderManager.patch b/leaf-server/minecraft-patches/features/0137-Rework-ChunkHolderManager.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0138-Rework-ChunkHolderManager.patch rename to leaf-server/minecraft-patches/features/0137-Rework-ChunkHolderManager.patch diff --git a/leaf-server/minecraft-patches/features/0139-Optimize-chunkUnload.patch b/leaf-server/minecraft-patches/features/0138-Optimize-chunkUnload.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0139-Optimize-chunkUnload.patch rename to leaf-server/minecraft-patches/features/0138-Optimize-chunkUnload.patch diff --git a/leaf-server/minecraft-patches/features/0140-Async-chunk-sending.patch b/leaf-server/minecraft-patches/features/0139-Async-chunk-sending.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0140-Async-chunk-sending.patch rename to leaf-server/minecraft-patches/features/0139-Async-chunk-sending.patch diff --git a/leaf-server/minecraft-patches/features/0141-Spawner-Configurations.patch b/leaf-server/minecraft-patches/features/0140-Spawner-Configurations.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0141-Spawner-Configurations.patch rename to leaf-server/minecraft-patches/features/0140-Spawner-Configurations.patch