测试缓存性能

This commit is contained in:
zhangyuheng 2024-05-28 19:54:25 +08:00
parent b18bbf5a7f
commit 1c6f9f410f
2 changed files with 5 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>Dominion</artifactId>
<version>1.28.11-beta</version>
<version>1.28.12-beta</version>
<packaging>jar</packaging>
<name>Dominion</name>

View File

@ -228,7 +228,8 @@ public class Cache {
}
private List<DominionDTO> getDominionsParentAndChildren(Location loc) {
// todo: 需要进一步优化性能考虑将领地按照mca文件分组减少遍历次数
// todo: 可能需要进一步优化性能考虑将领地按照mca文件分组减少遍历次数
long start = System.currentTimeMillis();
String world = loc.getWorld().getName();
List<Integer> dominions_id = world_dominions.get(world);
List<DominionDTO> in_dominions = new ArrayList<>();
@ -240,6 +241,8 @@ public class Cache {
}
}
in_dominions.sort(Comparator.comparingInt(DominionDTO::getId));
long end = System.currentTimeMillis();
// XLogger.debug("getDominionsParentAndChildren: %d ms", end - start);
return in_dominions;
}