SteamWar/SpigotCore
Archiviert
13
0

Add potential StartUpTime decrease by lazy loading commands only on usage #121

Zusammengeführt
Lixfel hat 4 Commits von StartTime nach master 2021-10-22 20:11:38 +02:00 zusammengeführt
Nur Änderungen aus Commit ef2ab78307 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -76,8 +76,6 @@ public abstract class SWCommand {
}
private synchronized void createMapping() {
Bukkit.getLogger().log(Level.INFO, () -> "Initializing: " + getClass().getTypeName());
long time = System.currentTimeMillis();
Method[] methods = getClass().getDeclaredMethods();
for (Method method : methods) {
addMapper(Mapper.class, method, i -> i == 0, false, TypeMapper.class, (anno, typeMapper) -> {
@ -134,7 +132,6 @@ public abstract class SWCommand {
});
commandHelpList.sort(Comparator.comparingInt(o -> -o.subCommand.length));
}
Bukkit.getLogger().log(Level.INFO, () -> "Load time for " + getClass().getTypeName() + " was " + (System.currentTimeMillis() - time) + "ms");
initialized = true;
}