Tweeks
This commit is contained in:
@@ -24,7 +24,7 @@ public class VoxyConfig {
|
||||
|
||||
public boolean enabled = true;
|
||||
public boolean ingestEnabled = true;
|
||||
public int renderDistance = 128;//Unused at the present
|
||||
public int renderDistance = 128;
|
||||
public int serviceThreads = Math.max(Runtime.getRuntime().availableProcessors()/2, 1);
|
||||
public String defaultSaveConfig;
|
||||
public int renderQuality = 256;//Smaller is higher quality
|
||||
|
||||
@@ -40,11 +40,11 @@ public class HierarchicalNodeManager {
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
for(int x = -1; x<=1;x++) {
|
||||
for (int z = -1; z <= 1; z++) {
|
||||
for(int x = -100; x<=100;x++) {
|
||||
for (int z = -100; z <= 100; z++) {
|
||||
for (int y = -3; y <= 3; y++) {
|
||||
updateFilterer.watch(4,x,y,z);
|
||||
updateFilterer.unwatch(4,x,y,z);
|
||||
updateFilterer.watch(0,x,y,z);
|
||||
updateFilterer.unwatch(0,x,y,z);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,6 +102,15 @@ public class HierarchicalNodeManager {
|
||||
}
|
||||
|
||||
public void processBuildResult(BuiltSection section) {
|
||||
section.free();
|
||||
/*
|
||||
if (!section.isEmpty()) {
|
||||
this.geometryManager.uploadSection(section);
|
||||
} else {
|
||||
section.free();
|
||||
}
|
||||
*/
|
||||
|
||||
int nodeId = this.activeSectionMap.get(section.position);
|
||||
if (nodeId == -1) {
|
||||
//Not tracked or mapped to a node!!!
|
||||
|
||||
@@ -126,7 +126,7 @@ public class WorldImporter {
|
||||
this.totalRegions.addAndGet(1);
|
||||
workers.submit(() -> {
|
||||
try {
|
||||
if (!isRunning) {
|
||||
if (!this.isRunning) {
|
||||
return;
|
||||
}
|
||||
this.importRegionFile(file.toPath(), rx, rz);
|
||||
|
||||
@@ -100,4 +100,8 @@ public class ServiceSlice extends TrackedObject {
|
||||
public int getJobCount() {
|
||||
return this.jobCount.availablePermits();
|
||||
}
|
||||
|
||||
public boolean hasJobs() {
|
||||
return this.jobCount.availablePermits() != 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ public class ServiceThreadPool {
|
||||
|
||||
private void worker(int threadId) {
|
||||
long seed = 1234342;
|
||||
int revolvingSelector = 0;
|
||||
while (true) {
|
||||
this.jobCounter.acquireUninterruptibly();
|
||||
if (!this.running) {
|
||||
@@ -102,12 +103,29 @@ public class ServiceThreadPool {
|
||||
System.err.println("Service worker tried to run but had 0 slices");
|
||||
break;
|
||||
}
|
||||
long chosenNumber = clamped % this.totalJobWeight.get();
|
||||
|
||||
|
||||
ServiceSlice service = ref[(int) (clamped % ref.length)];
|
||||
for (var slice : ref) {
|
||||
chosenNumber -= ((long) slice.weightPerJob) * slice.jobCount.availablePermits();
|
||||
if (chosenNumber <= 0) {
|
||||
service = slice;
|
||||
//1 in 64 chance just to pick a service that has a task, in a cycling manor, this is to keep at least one service from overloading all services constantly
|
||||
if (((seed>>10)&63) == 0) {
|
||||
for (int i = 0; i < ref.length; i++) {
|
||||
int idx = (i+revolvingSelector)%ref.length;
|
||||
var slice = ref[idx];
|
||||
if (slice.hasJobs()) {
|
||||
service = slice;
|
||||
revolvingSelector = (idx+1)%ref.length;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
long chosenNumber = clamped % this.totalJobWeight.get();
|
||||
for (var slice : ref) {
|
||||
chosenNumber -= ((long) slice.weightPerJob) * slice.jobCount.availablePermits();
|
||||
if (chosenNumber <= 0) {
|
||||
service = slice;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user