mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-30 14:13:38 +01:00
Propagate stateByID scaling performance improvement
This commit is contained in:
parent
aef7a16b1c
commit
0809d23559
@ -179,7 +179,7 @@ public class DynmapPlugin {
|
|||||||
int idx = bsids.getId(bs);
|
int idx = bsids.getId(bs);
|
||||||
if (idx >= stateByID.length) {
|
if (idx >= stateByID.length) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, idx + 1);
|
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
Block b = bs.getBlock();
|
Block b = bs.getBlock();
|
||||||
|
@ -177,7 +177,7 @@ public class DynmapPlugin {
|
|||||||
int idx = bsids.getId(bs);
|
int idx = bsids.getId(bs);
|
||||||
if (idx >= stateByID.length) {
|
if (idx >= stateByID.length) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, idx + 1);
|
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
Block b = bs.getBlock();
|
Block b = bs.getBlock();
|
||||||
|
@ -177,7 +177,7 @@ public class DynmapPlugin {
|
|||||||
int idx = bsids.getRawId(bs);
|
int idx = bsids.getRawId(bs);
|
||||||
if (idx >= stateByID.length) {
|
if (idx >= stateByID.length) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, idx + 1);
|
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
Block b = bs.getBlock();
|
Block b = bs.getBlock();
|
||||||
|
@ -177,7 +177,7 @@ public class DynmapPlugin {
|
|||||||
int idx = bsids.getRawId(bs);
|
int idx = bsids.getRawId(bs);
|
||||||
if (idx >= stateByID.length) {
|
if (idx >= stateByID.length) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, idx + 1);
|
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
Block b = bs.getBlock();
|
Block b = bs.getBlock();
|
||||||
|
@ -177,7 +177,7 @@ public class DynmapPlugin
|
|||||||
int i = Block.getIdFromBlock(b);
|
int i = Block.getIdFromBlock(b);
|
||||||
if (i >= (stateByID.length >> 4)) {
|
if (i >= (stateByID.length >> 4)) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, (i+1) << 4);
|
stateByID = Arrays.copyOf(stateByID, i*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
ResourceLocation ui = null;
|
ResourceLocation ui = null;
|
||||||
|
@ -178,7 +178,7 @@ public class DynmapPlugin
|
|||||||
int i = Block.getIdFromBlock(b);
|
int i = Block.getIdFromBlock(b);
|
||||||
if (i >= (stateByID.length >> 4)) {
|
if (i >= (stateByID.length >> 4)) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, (i+1) << 4);
|
stateByID = Arrays.copyOf(stateByID, i*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
ResourceLocation ui = null;
|
ResourceLocation ui = null;
|
||||||
|
@ -201,7 +201,7 @@ public class DynmapPlugin
|
|||||||
int idx = bsids.get(bs);
|
int idx = bsids.get(bs);
|
||||||
if (idx >= stateByID.length) {
|
if (idx >= stateByID.length) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, idx+1);
|
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
Block b = bs.getBlock();
|
Block b = bs.getBlock();
|
||||||
|
@ -227,7 +227,7 @@ public class DynmapPlugin
|
|||||||
int idx = bsids.get(bs);
|
int idx = bsids.get(bs);
|
||||||
if (idx >= stateByID.length) {
|
if (idx >= stateByID.length) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, idx+1);
|
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
Block b = bs.getBlock();
|
Block b = bs.getBlock();
|
||||||
|
@ -228,7 +228,7 @@ public class DynmapPlugin
|
|||||||
int idx = bsids.get(bs);
|
int idx = bsids.get(bs);
|
||||||
if (idx >= stateByID.length) {
|
if (idx >= stateByID.length) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, idx+1);
|
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
Block b = bs.getBlock();
|
Block b = bs.getBlock();
|
||||||
|
@ -229,7 +229,7 @@ public class DynmapPlugin
|
|||||||
int idx = bsids.get(bs);
|
int idx = bsids.get(bs);
|
||||||
if (idx >= stateByID.length) {
|
if (idx >= stateByID.length) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, idx+1);
|
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
Block b = bs.getBlock();
|
Block b = bs.getBlock();
|
||||||
|
@ -239,7 +239,7 @@ public class DynmapPlugin
|
|||||||
int idx = bsids.getId(bs);
|
int idx = bsids.getId(bs);
|
||||||
if (idx >= stateByID.length) {
|
if (idx >= stateByID.length) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, idx+1);
|
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
Block b = bs.getBlock();
|
Block b = bs.getBlock();
|
||||||
|
@ -239,7 +239,7 @@ public class DynmapPlugin
|
|||||||
int idx = bsids.getId(bs);
|
int idx = bsids.getId(bs);
|
||||||
if (idx >= stateByID.length) {
|
if (idx >= stateByID.length) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, idx+1);
|
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
Block b = bs.getBlock();
|
Block b = bs.getBlock();
|
||||||
|
@ -239,7 +239,7 @@ public class DynmapPlugin
|
|||||||
int idx = bsids.getId(bs);
|
int idx = bsids.getId(bs);
|
||||||
if (idx >= stateByID.length) {
|
if (idx >= stateByID.length) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, idx+1);
|
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
Block b = bs.getBlock();
|
Block b = bs.getBlock();
|
||||||
|
@ -240,7 +240,6 @@ public class DynmapPlugin
|
|||||||
if (idx >= stateByID.length) {
|
if (idx >= stateByID.length) {
|
||||||
int plen = stateByID.length;
|
int plen = stateByID.length;
|
||||||
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
stateByID = Arrays.copyOf(stateByID, idx*11/10); // grow array by 10%
|
||||||
Log.debug("Resized stateByID from " + plen + " to " + stateByID.length);
|
|
||||||
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
Arrays.fill(stateByID, plen, stateByID.length, DynmapBlockState.AIR);
|
||||||
}
|
}
|
||||||
Block b = bs.getBlock();
|
Block b = bs.getBlock();
|
||||||
|
Loading…
Reference in New Issue
Block a user