mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
1056951a73
Remove Debug checks as these are super hot and causing noticeable hits Before: http://i.imgur.com/nQsMzAE.png After: http://i.imgur.com/nJ46crB.png Optimize redundant converting of static fields into an unsigned long each call by precomputing it in ctor
32 lines
1.5 KiB
Diff
32 lines
1.5 KiB
Diff
--- a/net/minecraft/util/ZeroBitStorage.java
|
|
+++ b/net/minecraft/util/ZeroBitStorage.java
|
|
@@ -13,21 +13,21 @@
|
|
}
|
|
|
|
@Override
|
|
- public int getAndSet(int index, int value) {
|
|
- Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index);
|
|
- Validate.inclusiveBetween(0L, 0L, (long)value);
|
|
+ public final int getAndSet(int index, int value) { // Paper - Perf: Optimize SimpleBitStorage
|
|
+ //Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index); // Paper - Perf: Optimize SimpleBitStorage
|
|
+ //Validate.inclusiveBetween(0L, 0L, (long)value); // Paper - Perf: Optimize SimpleBitStorage
|
|
return 0;
|
|
}
|
|
|
|
@Override
|
|
- public void set(int index, int value) {
|
|
- Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index);
|
|
- Validate.inclusiveBetween(0L, 0L, (long)value);
|
|
+ public final void set(int index, int value) { // Paper - Perf: Optimize SimpleBitStorage
|
|
+ //Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index); // Paper - Perf: Optimize SimpleBitStorage
|
|
+ //Validate.inclusiveBetween(0L, 0L, (long)value); // Paper - Perf: Optimize SimpleBitStorage
|
|
}
|
|
|
|
@Override
|
|
- public int get(int index) {
|
|
- Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index);
|
|
+ public final int get(int index) { // Paper - Perf: Optimize SimpleBitStorage
|
|
+ //Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index); // Paper - Perf: Optimize SimpleBitStorage
|
|
return 0;
|
|
}
|
|
|