Even more work

This commit is contained in:
Nassim Jahnke 2024-12-03 21:03:25 +01:00
parent a894c3a437
commit 0e668caa27
3 changed files with 17 additions and 8 deletions

View file

@ -43,11 +43,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java
@@ -0,0 +0,0 @@ public class DimensionDataStorage implements AutoCloseable {
} catch (IOException var3) {
LOGGER.error("Could not save data to {}", path.getFileName(), var3);
}
- }, Util.ioPool());
+ }, Util.DIMENSION_DATA_IO_POOL); // Paper - Separate dimension data IO pool
}
public void saveAndJoin() {
} else {
int i = Util.maxAllowedExecutorThreads();
int j = map.size();
- if (j > i) {
+ if (false && j > i) { // Paper - Separate dimension data IO pool; just throw them into the fixed pool queue
this.pendingWriteFuture = this.pendingWriteFuture.thenCompose(object -> {
List<CompletableFuture<?>> list = new ArrayList<>(i);
int k = Mth.positiveCeilDiv(j, i);
@@ -0,0 +0,0 @@ public class DimensionDataStorage implements AutoCloseable {
v -> CompletableFuture.allOf(
map.entrySet()
.stream()
- .map(entry -> CompletableFuture.runAsync(() -> tryWrite(entry.getKey(), entry.getValue()), Util.ioPool()))
+ .map(entry -> CompletableFuture.runAsync(() -> tryWrite(entry.getKey(), entry.getValue()), Util.DIMENSION_DATA_IO_POOL)) // Paper - Separate dimension data IO pool
.toArray(CompletableFuture[]::new)
)
);