mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 11:45:52 -07:00
Add LongObjectHashMap and LongHashSet
Replace uses of LongHashtable and LongHashset with new implementations. Remove EntryBase, LongBaseHashtable, LongHashset, and LongHashtable as they are no longer used. LongObjectHashMap does not use Entry or EntryBase classes internally for storage so has much lower object churn and greater performance. LongHashSet is not as much of performance win for our use case but for general use is up to seventeen times faster than the old implementation and is in fact faster than alternatives from "high performance" java libraries. This is being added so that if someone tries to use it in the future in a place unrelated to its current use they don't accidentally end up with something slower than the Java collections HashSet implementation.
This commit is contained in:
@@ -11,20 +11,20 @@ import java.util.Set;
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.craftbukkit.util.LongHashset;
|
||||
import org.bukkit.craftbukkit.util.LongHashtable;
|
||||
import org.bukkit.craftbukkit.util.LongHashSet;
|
||||
import org.bukkit.craftbukkit.util.LongObjectHashMap;
|
||||
import org.bukkit.event.world.ChunkUnloadEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
public class ChunkProviderServer implements IChunkProvider {
|
||||
|
||||
// CraftBukkit start
|
||||
public LongHashset unloadQueue = new LongHashset();
|
||||
public LongHashSet unloadQueue = new LongHashSet();
|
||||
public Chunk emptyChunk;
|
||||
public IChunkProvider chunkProvider; // CraftBukkit
|
||||
private IChunkLoader e;
|
||||
public boolean forceChunkLoad = false; // true -> false
|
||||
public LongHashtable<Chunk> chunks = new LongHashtable<Chunk>();
|
||||
public LongObjectHashMap<Chunk> chunks = new LongObjectHashMap<Chunk>();
|
||||
public List chunkList = new ArrayList();
|
||||
public WorldServer world;
|
||||
// CraftBukkit end
|
||||
|
Reference in New Issue
Block a user