diff options
author | Kyle Wood <[email protected]> | 2021-06-24 01:21:17 -0500 |
---|---|---|
committer | Kyle Wood <[email protected]> | 2021-06-24 01:21:17 -0500 |
commit | 6ab98f8e35c9c941759ff1d15e15f66293c1983a (patch) | |
tree | 4635cf11ddcc351d65044664d17924067f373fb2 /Spigot-Server-Patches-Unmapped/0246-Optimize-RegistryID.c.patch | |
parent | 216bd81bef963ff595eff88b68e9737977c40f66 (diff) | |
download | Paper-6ab98f8e35c9c941759ff1d15e15f66293c1983a.tar.gz Paper-6ab98f8e35c9c941759ff1d15e15f66293c1983a.zip |
More changes for new paperweight
Diffstat (limited to 'Spigot-Server-Patches-Unmapped/0246-Optimize-RegistryID.c.patch')
-rw-r--r-- | Spigot-Server-Patches-Unmapped/0246-Optimize-RegistryID.c.patch | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/Spigot-Server-Patches-Unmapped/0246-Optimize-RegistryID.c.patch b/Spigot-Server-Patches-Unmapped/0246-Optimize-RegistryID.c.patch deleted file mode 100644 index 028620de8b..0000000000 --- a/Spigot-Server-Patches-Unmapped/0246-Optimize-RegistryID.c.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Andrew Steinborn <[email protected]> -Date: Mon, 23 Jul 2018 13:08:19 -0400 -Subject: [PATCH] Optimize RegistryID.c() - -This is a frequent hotspot for world loading/saving. - -diff --git a/src/main/java/net/minecraft/util/RegistryID.java b/src/main/java/net/minecraft/util/RegistryID.java -index 6150f7a5c5004ac79414ab22dbaa3439dc8afdb4..a59dbfa01743137702b122f73c778452e63115b5 100644 ---- a/src/main/java/net/minecraft/util/RegistryID.java -+++ b/src/main/java/net/minecraft/util/RegistryID.java -@@ -15,12 +15,14 @@ public class RegistryID<K> implements Registry<K> { - private K[] d; - private int e; - private int f; -+ private java.util.BitSet usedIds; // Paper - - public RegistryID(int i) { - i = (int) ((float) i / 0.8F); - this.b = (K[]) (new Object[i]); // Paper - decompile fix - this.c = new int[i]; - this.d = (K[]) (new Object[i]); // Paper - decompile fix -+ this.usedIds = new java.util.BitSet(); // Paper - } - - // Paper start - decompile fix -@@ -52,9 +54,14 @@ public class RegistryID<K> implements Registry<K> { - } - - private int c() { -+ // Paper start -+ /* - while (this.e < this.d.length && this.d[this.e] != null) { - ++this.e; - } -+ */ -+ this.e = this.usedIds.nextClearBit(0); -+ // Paper end - - return this.e; - } -@@ -68,6 +75,7 @@ public class RegistryID<K> implements Registry<K> { - this.d = (K[]) (new Object[i]); // Paper - decompile fix - this.e = 0; - this.f = 0; -+ this.usedIds.clear(); // Paper - - for (int j = 0; j < ak.length; ++j) { - if (ak[j] != null) { -@@ -93,6 +101,7 @@ public class RegistryID<K> implements Registry<K> { - this.b[k] = k0; - this.c[k] = i; - this.d[i] = k0; -+ this.usedIds.set(i); // Paper - ++this.f; - if (i == this.e) { - ++this.e; -@@ -157,6 +166,7 @@ public class RegistryID<K> implements Registry<K> { - Arrays.fill(this.d, (Object) null); - this.e = 0; - this.f = 0; -+ this.usedIds.clear(); // Paper - } - - public int b() { |