From ed0d80b37ef3b6c741ff77568b797fcfe0c1c0f4 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 31 Aug 2024 15:01:37 -0500 Subject: [PATCH] Reduce deplayed LOD modified save from 2 sec -> 500 ms This should make some LOD update operations appear faster --- .../seibel/distanthorizons/core/level/AbstractDhLevel.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/AbstractDhLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/AbstractDhLevel.java index c255b5e90..9bb1cca74 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/AbstractDhLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/AbstractDhLevel.java @@ -39,12 +39,9 @@ import org.jetbrains.annotations.Nullable; import java.io.File; import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicInteger; public abstract class AbstractDhLevel implements IDhLevel { @@ -57,7 +54,7 @@ public abstract class AbstractDhLevel implements IDhLevel @Nullable public BeaconBeamRepo beaconBeamRepo; - protected final DelayedFullDataSourceSaveCache delayedFullDataSourceSaveCache = new DelayedFullDataSourceSaveCache(this::onDataSourceSave, 2_000); + protected final DelayedFullDataSourceSaveCache delayedFullDataSourceSaveCache = new DelayedFullDataSourceSaveCache(this::onDataSourceSave, 500); /** contains the {@link DhChunkPos} for each {@link DhSectionPos} that are queued to save via {@link AbstractDhLevel#delayedFullDataSourceSaveCache} */ protected final ConcurrentHashMap> updatedChunkPosSetBySectionPos = new ConcurrentHashMap<>(); protected final ConcurrentHashMap updatedChunkHashesByChunkPos = new ConcurrentHashMap<>();