mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 04:33:56 -07:00
Add iterator cache to UnsafeList and use it in hotspots
Adds a specialized iterator for the list and a pool of iterators to avoid object churn. Also optimizes the clear() method to reduce object creation.
This commit is contained in:
@@ -57,7 +57,7 @@ public class Chunk {
|
||||
this.heightMap = new int[256];
|
||||
|
||||
for (int k = 0; k < this.entitySlices.length; ++k) {
|
||||
this.entitySlices[k] = new ArrayList();
|
||||
this.entitySlices[k] = new org.bukkit.craftbukkit.util.UnsafeList(); // CraftBukkit - ArrayList -> UnsafeList
|
||||
}
|
||||
|
||||
Arrays.fill(this.b, -999);
|
||||
|
Reference in New Issue
Block a user