mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 00:07:56 +01:00
Manually inline PooledBlockPosition#d(int, int, int)
This commit is contained in:
parent
8ed5bbea20
commit
f884a07f57
@ -20,6 +20,9 @@ This should result in an across the board speedup in anything that accesses bloc
|
||||
This is based upon conclusions drawn from inspecting the assenmbly generated bythe JIT compiler on my microbenchmarks.
|
||||
They had 'callq' (invoke) instead of 'mov' (get from memory) instructions.
|
||||
|
||||
In addition, manually inline PooledBlockPosition#d(int, int, int) as it is a hot method that doesn't get inlined due to
|
||||
invokespecial instructions.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
|
||||
@ -161,6 +164,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
public BlockPosition a(double d0, double d1, double d2) {
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
||||
|
||||
@Override
|
||||
public BlockPosition.PooledBlockPosition d(int i, int j, int k) {
|
||||
- return (BlockPosition.PooledBlockPosition) super.d(i, j, k);
|
||||
+ // Paper start - manually inline this hot method
|
||||
+ //return (BlockPosition.PooledBlockPosition) super.d(i, j, k);
|
||||
+ this.x = i;
|
||||
+ this.y = j;
|
||||
+ this.z = k;
|
||||
+ return this;
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
||||
}
|
||||
|
||||
public static class MutableBlockPosition extends BlockPosition {
|
||||
|
Loading…
Reference in New Issue
Block a user