mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
chore: add some timings for Tier 2 init
This commit is contained in:
parent
8d33252cee
commit
c72581d3bb
2 changed files with 67 additions and 41 deletions
|
|
@ -185,21 +185,27 @@ namespace Dalamud
|
||||||
Service<NetworkHandlers>.Set();
|
Service<NetworkHandlers>.Set();
|
||||||
Log.Information("[T2] NH OK!");
|
Log.Information("[T2] NH OK!");
|
||||||
|
|
||||||
|
using (Timings.Start("DM Init"))
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Service<DataManager>.Set().Initialize(this.AssetDirectory.FullName);
|
Service<DataManager>.Set().Initialize(this.AssetDirectory.FullName);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.Error(e, "Could not initialize DataManager.");
|
Log.Error(e, "Could not initialize DataManager");
|
||||||
this.Unload();
|
this.Unload();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Log.Information("[T2] Data OK!");
|
Log.Information("[T2] Data OK!");
|
||||||
|
|
||||||
var clientState = Service<ClientState>.Set();
|
using (Timings.Start("CS Init"))
|
||||||
|
{
|
||||||
|
Service<ClientState>.Set();
|
||||||
Log.Information("[T2] CS OK!");
|
Log.Information("[T2] CS OK!");
|
||||||
|
}
|
||||||
|
|
||||||
var localization = Service<Localization>.Set(new Localization(Path.Combine(this.AssetDirectory.FullName, "UIRes", "loc", "dalamud"), "dalamud_"));
|
var localization = Service<Localization>.Set(new Localization(Path.Combine(this.AssetDirectory.FullName, "UIRes", "loc", "dalamud"), "dalamud_"));
|
||||||
if (!string.IsNullOrEmpty(configuration.LanguageOverride))
|
if (!string.IsNullOrEmpty(configuration.LanguageOverride))
|
||||||
|
|
@ -214,14 +220,23 @@ namespace Dalamud
|
||||||
Log.Information("[T2] LOC OK!");
|
Log.Information("[T2] LOC OK!");
|
||||||
|
|
||||||
// This is enabled in ImGuiScene setup
|
// This is enabled in ImGuiScene setup
|
||||||
|
using (Timings.Start("IME Init"))
|
||||||
|
{
|
||||||
Service<DalamudIME>.Set();
|
Service<DalamudIME>.Set();
|
||||||
Log.Information("[T2] IME OK!");
|
Log.Information("[T2] IME OK!");
|
||||||
|
}
|
||||||
|
|
||||||
|
using (Timings.Start("IM Enable"))
|
||||||
|
{
|
||||||
Service<InterfaceManager>.Set().Enable();
|
Service<InterfaceManager>.Set().Enable();
|
||||||
Log.Information("[T2] IM OK!");
|
Log.Information("[T2] IM OK!");
|
||||||
|
}
|
||||||
|
|
||||||
|
using (Timings.Start("GFM Init"))
|
||||||
|
{
|
||||||
Service<GameFontManager>.Set();
|
Service<GameFontManager>.Set();
|
||||||
Log.Information("[T2] GFM OK!");
|
Log.Information("[T2] GFM OK!");
|
||||||
|
}
|
||||||
|
|
||||||
#pragma warning disable CS0618 // Type or member is obsolete
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
Service<SeStringManager>.Set();
|
Service<SeStringManager>.Set();
|
||||||
|
|
@ -229,27 +244,30 @@ namespace Dalamud
|
||||||
|
|
||||||
Log.Information("[T2] SeString OK!");
|
Log.Information("[T2] SeString OK!");
|
||||||
|
|
||||||
// Initialize managers. Basically handlers for the logic
|
using (Timings.Start("CM Init"))
|
||||||
|
{
|
||||||
Service<CommandManager>.Set();
|
Service<CommandManager>.Set();
|
||||||
|
|
||||||
Service<DalamudCommands>.Set().SetupCommands();
|
Service<DalamudCommands>.Set().SetupCommands();
|
||||||
|
|
||||||
Log.Information("[T2] CM OK!");
|
Log.Information("[T2] CM OK!");
|
||||||
|
}
|
||||||
|
|
||||||
Service<ChatHandlers>.Set();
|
Service<ChatHandlers>.Set();
|
||||||
|
|
||||||
Log.Information("[T2] CH OK!");
|
Log.Information("[T2] CH OK!");
|
||||||
|
|
||||||
clientState.Enable();
|
using (Timings.Start("CS Enable"))
|
||||||
|
{
|
||||||
|
Service<ClientState>.Get().Enable();
|
||||||
Log.Information("[T2] CS ENABLE!");
|
Log.Information("[T2] CS ENABLE!");
|
||||||
|
}
|
||||||
|
|
||||||
Service<DalamudAtkTweaks>.Set().Enable();
|
Service<DalamudAtkTweaks>.Set().Enable();
|
||||||
|
Log.Information("[T2] ATKTWEAKS ENABLE!");
|
||||||
|
|
||||||
Log.Information("[T2] Load complete!");
|
Log.Information("[T2] Load complete!");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Error(ex, "Tier 2 load failed.");
|
Log.Error(ex, "Tier 2 load failed");
|
||||||
this.Unload();
|
this.Unload();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -308,17 +326,17 @@ namespace Dalamud
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Error(ex, "Plugin load failed.");
|
Log.Error(ex, "Plugin load failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
Troubleshooting.LogTroubleshooting();
|
Troubleshooting.LogTroubleshooting();
|
||||||
|
|
||||||
Log.Information("Dalamud is ready.");
|
Log.Information("Dalamud is ready");
|
||||||
Timings.Event("Dalamud ready");
|
Timings.Event("Dalamud ready");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Error(ex, "Tier 3 load failed.");
|
Log.Error(ex, "Tier 3 load failed");
|
||||||
this.Unload();
|
this.Unload();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ using Dalamud.Interface.Internal;
|
||||||
using Dalamud.IoC;
|
using Dalamud.IoC;
|
||||||
using Dalamud.IoC.Internal;
|
using Dalamud.IoC.Internal;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
|
using Dalamud.Utility.Timing;
|
||||||
using ImGuiScene;
|
using ImGuiScene;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Lumina;
|
using Lumina;
|
||||||
|
|
@ -298,6 +299,8 @@ namespace Dalamud.Data
|
||||||
|
|
||||||
Log.Verbose("Loaded {0} ClientOpCodes.", clientOpCodeDict.Count);
|
Log.Verbose("Loaded {0} ClientOpCodes.", clientOpCodeDict.Count);
|
||||||
|
|
||||||
|
using (Timings.Start("Lumina Init"))
|
||||||
|
{
|
||||||
var luminaOptions = new LuminaOptions
|
var luminaOptions = new LuminaOptions
|
||||||
{
|
{
|
||||||
CacheFileResources = true,
|
CacheFileResources = true,
|
||||||
|
|
@ -314,8 +317,13 @@ namespace Dalamud.Data
|
||||||
{
|
{
|
||||||
this.GameData = new GameData(Path.Combine(Path.GetDirectoryName(processModule.FileName), "sqpack"), luminaOptions);
|
this.GameData = new GameData(Path.Combine(Path.GetDirectoryName(processModule.FileName), "sqpack"), luminaOptions);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("Could not main module.");
|
||||||
|
}
|
||||||
|
|
||||||
Log.Information("Lumina is ready: {0}", this.GameData.DataPath);
|
Log.Information("Lumina is ready: {0}", this.GameData.DataPath);
|
||||||
|
}
|
||||||
|
|
||||||
this.IsDataReady = true;
|
this.IsDataReady = true;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue