9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-30 04:29:05 +00:00

so I didnt know that

This commit is contained in:
RePixelatedMC
2023-11-29 14:43:06 +01:00
parent 815b2235a2
commit 17f8fe69fb
4 changed files with 13 additions and 8 deletions

View File

@@ -57,7 +57,8 @@ public class CommandDeveloper implements DecreeExecutor {
Iris.info(C.DARK_PURPLE + "Engine Status");
Iris.info(C.DARK_PURPLE + "Tectonic Threads: " + C.LIGHT_PURPLE + engine.getMantle().getDynamicThreads());
Iris.info(C.DARK_PURPLE + "Tectonic Limit: " + C.LIGHT_PURPLE + engine.getMantle().getTectonicLimit());
Iris.info(C.DARK_PURPLE + "Tectonic Plates: " + C.LIGHT_PURPLE + engine.getMantle().getLoadedRegionCount());
Iris.info(C.DARK_PURPLE + "Tectonic Loaded Plates: " + C.LIGHT_PURPLE + engine.getMantle().getLoadedRegionCount());
Iris.info(C.DARK_PURPLE + "Tectonic Plates: " + C.LIGHT_PURPLE + engine.getMantle().getNotClearedLoadedRegions());
Iris.info(C.DARK_PURPLE + "Tectonic ToUnload: " + C.LIGHT_PURPLE + engine.getMantle().getToUnload());
Iris.info(C.DARK_PURPLE + "Tectonic Unload Duration: " + C.LIGHT_PURPLE + Form.duration((long) engine.getMantle().getTectonicDuration()));
Iris.info(C.DARK_PURPLE + "Cache Size: " + C.LIGHT_PURPLE + Form.f(IrisData.cacheSize()));

View File

@@ -33,8 +33,8 @@ public class DynamicPerformanceSVC implements IrisService {
protected long loop() {
try {
if (engine.getMantle().getTectonicLimit() < engine.getMantle().getLoadedRegionCount()){
// engine.getMantle().trim(5);
// return 2000;
engine.getMantle().trim(5);
return 2000;
}
} catch (Throwable e) {
Iris.reportError(e);

View File

@@ -301,6 +301,9 @@ public interface EngineMantle extends IObjectPlacer {
default double getTectonicLimit(){
return Mantle.tectonicLimit.get();
}
default long getNotClearedLoadedRegions(){
return getMantle().getLoadedRegions().size() - getMantle().getToUnload().size();
}
default double getTectonicDuration(){
return getMantle().getAdjustedIdleDuration().get();
}

View File

@@ -388,8 +388,6 @@ public class Mantle {
return numberOfEntries * bytesPerEntry;
}
//@Getter
//private final AtomicInteger fakeToUnload = new AtomicInteger(0);
private final AtomicInteger oldFakeToUnload = new AtomicInteger((0));
@Getter
private final AtomicDouble adjustedIdleDuration = new AtomicDouble(0);
@@ -479,9 +477,12 @@ public class Mantle {
if (IrisSettings.get().getPerformance().AggressiveTectonicUnload
&& loadedRegions.size() > forceAggressiveThreshold.get()) {
AtomicInteger dummyLoadedRegions = new AtomicInteger(loadedRegions.size());
AtomicInteger regionCountToRemove = new AtomicInteger(0);
if (loadedRegions.size() > tectonicLimit.get()){
regionCountToRemove.set(loadedRegions.size() - tectonicLimit.get());
}
while (dummyLoadedRegions.get() > tectonicLimit.get()) {
for (; regionCountToRemove.get() > 0 ;) {
Long[] oldestKey = {null};
long[] oldestAge = {Long.MIN_VALUE};
@@ -502,7 +503,7 @@ public class Mantle {
hyperLock.withLong(finalOldestKey, () -> {
toUnload.add(finalOldestKey);
Iris.debug("Oldest Tectonic Region " + finalOldestKey + " added to unload");
dummyLoadedRegions.getAndDecrement();
regionCountToRemove.getAndDecrement();
});
}
}