mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-17 06:11:06 +00:00
Raw data
This commit is contained in:
@@ -33,7 +33,7 @@ public class DynamicPerformanceSVC implements IrisService {
|
|||||||
protected long loop() {
|
protected long loop() {
|
||||||
try {
|
try {
|
||||||
if (engine.getMantle().getTectonicLimit() < engine.getMantle().getLoadedRegionCount()){
|
if (engine.getMantle().getTectonicLimit() < engine.getMantle().getLoadedRegionCount()){
|
||||||
engine.getMantle().trim(5);
|
// engine.getMantle().trim(5);
|
||||||
return 2000;
|
return 2000;
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ public interface EngineMantle extends IObjectPlacer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default long getToUnload(){
|
default long getToUnload(){
|
||||||
return getMantle().getFakeToUnload().get();
|
return getMantle().getToUnload().size();
|
||||||
}
|
}
|
||||||
default long getDynamicThreads(){
|
default long getDynamicThreads(){
|
||||||
return getMantle().getDynamicThreads().get();
|
return getMantle().getDynamicThreads().get();
|
||||||
|
|||||||
@@ -389,8 +389,8 @@ public class Mantle {
|
|||||||
return numberOfEntries * bytesPerEntry;
|
return numberOfEntries * bytesPerEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
//@Getter
|
||||||
private final AtomicInteger fakeToUnload = new AtomicInteger(0);
|
//private final AtomicInteger fakeToUnload = new AtomicInteger(0);
|
||||||
private final AtomicInteger oldFakeToUnload = new AtomicInteger((0));
|
private final AtomicInteger oldFakeToUnload = new AtomicInteger((0));
|
||||||
@Getter
|
@Getter
|
||||||
private final AtomicDouble adjustedIdleDuration = new AtomicDouble(0);
|
private final AtomicDouble adjustedIdleDuration = new AtomicDouble(0);
|
||||||
@@ -401,6 +401,8 @@ public class Mantle {
|
|||||||
private final AtomicInteger forceAggressiveThreshold = new AtomicInteger(30);
|
private final AtomicInteger forceAggressiveThreshold = new AtomicInteger(30);
|
||||||
@Getter
|
@Getter
|
||||||
private final AtomicLong oldestTectonicPlate = new AtomicLong(0);
|
private final AtomicLong oldestTectonicPlate = new AtomicLong(0);
|
||||||
|
@Getter
|
||||||
|
private final Set<Long> toUnload = new HashSet<>();
|
||||||
private int g = 0;
|
private int g = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -422,8 +424,8 @@ public class Mantle {
|
|||||||
if(IrisSettings.get().getPerformance().dynamicPerformanceMode) {
|
if(IrisSettings.get().getPerformance().dynamicPerformanceMode) {
|
||||||
// todo Repixel improve the logic
|
// todo Repixel improve the logic
|
||||||
int h = dynamicThreads.get() - 1;
|
int h = dynamicThreads.get() - 1;
|
||||||
if (fakeToUnload.get() != 0) {
|
if (toUnload.size() != 0) {
|
||||||
if (fakeToUnload.get() > oldFakeToUnload.get()) {
|
if (toUnload.size() > oldFakeToUnload.get()) {
|
||||||
g++;
|
g++;
|
||||||
if (g >= 2 && IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getParallelism()) > h && IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getParallelism()) != h) {
|
if (g >= 2 && IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getParallelism()) > h && IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getParallelism()) != h) {
|
||||||
dynamicThreads.addAndGet(1);
|
dynamicThreads.addAndGet(1);
|
||||||
@@ -436,7 +438,7 @@ public class Mantle {
|
|||||||
dynamicThreads.addAndGet(-1);
|
dynamicThreads.addAndGet(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
oldFakeToUnload.set(fakeToUnload.get());
|
oldFakeToUnload.set(toUnload.size());
|
||||||
}
|
}
|
||||||
if (!IrisSettings.get().getPerformance().dynamicPerformanceMode){
|
if (!IrisSettings.get().getPerformance().dynamicPerformanceMode){
|
||||||
if(IrisSettings.get().getPerformance().getTectonicUnloadThreads() <= -1){
|
if(IrisSettings.get().getPerformance().getTectonicUnloadThreads() <= -1){
|
||||||
@@ -461,7 +463,6 @@ public class Mantle {
|
|||||||
io.set(true);
|
io.set(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final Set<Long> toUnload = new HashSet<>();
|
|
||||||
Iris.debug("Trimming Tectonic Plates older than " + Form.duration(adjustedIdleDuration.get(), 0));
|
Iris.debug("Trimming Tectonic Plates older than " + Form.duration(adjustedIdleDuration.get(), 0));
|
||||||
|
|
||||||
for (Long i : lastUse.keySet()) {
|
for (Long i : lastUse.keySet()) {
|
||||||
@@ -469,7 +470,6 @@ public class Mantle {
|
|||||||
hyperLock.withLong(i, () -> {
|
hyperLock.withLong(i, () -> {
|
||||||
if (M.ms() - lastUse.get(i) >= finalAdjustedIdleDuration) {
|
if (M.ms() - lastUse.get(i) >= finalAdjustedIdleDuration) {
|
||||||
toUnload.add(i);
|
toUnload.add(i);
|
||||||
fakeToUnload.addAndGet(1);
|
|
||||||
Iris.debug("Tectonic Region added to unload");
|
Iris.debug("Tectonic Region added to unload");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -482,23 +482,21 @@ public class Mantle {
|
|||||||
Long[] oldestKey = {null};
|
Long[] oldestKey = {null};
|
||||||
long[] oldestAge = {Long.MIN_VALUE};
|
long[] oldestAge = {Long.MIN_VALUE};
|
||||||
|
|
||||||
for (Long key : lastUse.keySet()) {
|
for (Long key : lastUse.keySet()) {
|
||||||
|
if (!toUnload.contains(key)) {
|
||||||
long age = M.ms() - lastUse.get(key);
|
long age = M.ms() - lastUse.get(key);
|
||||||
if (age > oldestAge[0]) {
|
if (age > oldestAge[0]) {
|
||||||
oldestAge[0] = age;
|
oldestAge[0] = age;
|
||||||
oldestKey[0] = key;
|
oldestKey[0] = key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (oldestKey[0] != null) {
|
if (oldestKey[0] != null) {
|
||||||
Long finalOldestKey = oldestKey[0];
|
Long finalOldestKey = oldestKey[0];
|
||||||
hyperLock.withLong(finalOldestKey, () -> {
|
hyperLock.withLong(finalOldestKey, () -> {
|
||||||
toUnload.add(finalOldestKey);
|
toUnload.add(finalOldestKey);
|
||||||
fakeToUnload.addAndGet(1);
|
|
||||||
Iris.debug("Oldest Tectonic Region " + finalOldestKey + " added to unload");
|
Iris.debug("Oldest Tectonic Region " + finalOldestKey + " added to unload");
|
||||||
|
|
||||||
loadedRegions.remove(finalOldestKey);
|
|
||||||
lastUse.remove(finalOldestKey);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -516,7 +514,6 @@ public class Mantle {
|
|||||||
m.write(fileForRegion(dataFolder, i));
|
m.write(fileForRegion(dataFolder, i));
|
||||||
loadedRegions.remove(i);
|
loadedRegions.remove(i);
|
||||||
lastUse.remove(i);
|
lastUse.remove(i);
|
||||||
fakeToUnload.getAndDecrement();
|
|
||||||
Iris.debug("Unloaded Tectonic Plate " + C.DARK_GREEN + Cache.keyX(i) + " " + Cache.keyZ(i));
|
Iris.debug("Unloaded Tectonic Plate " + C.DARK_GREEN + Cache.keyX(i) + " " + Cache.keyZ(i));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
Reference in New Issue
Block a user