IDEA-CR-44706 make clear what's going on during app initialization preparation phase (third part, not fully covered)

This commit is contained in:
Vladimir Krivosheev
2019-03-11 10:56:18 +01:00
parent 898f3c5feb
commit ff9ed89a94
3 changed files with 4 additions and 3 deletions
@@ -67,8 +67,7 @@ public class IdeaApplication {
@SuppressWarnings("SSBasedInspection")
public static void initApplication(@NotNull String[] args) {
PluginManager.startupStart.end();
StartUpMeasurer.MeasureToken measureToken = StartUpMeasurer.start(StartUpMeasurer.Phases.INIT_APP);
StartUpMeasurer.MeasureToken measureToken = PluginManager.startupStart.endAndStart(StartUpMeasurer.Phases.INIT_APP);
IdeaApplication app = new IdeaApplication(args);
// this invokeLater() call is needed to place the app starting code on a freshly minted IdeEventQueue instance
SwingUtilities.invokeLater(() -> {
@@ -169,7 +169,7 @@ public class StartupUtil {
if (!Main.isHeadless()) {
measureToken = StartUpMeasurer.start(Phases.UPDATE_WINDOW_ICON);
AppUIUtil.updateWindowIcon(JOptionPane.getRootFrame());
measureToken.endAndStart(Phases.REGISTER_BUNDLED_FONTS);
measureToken = measureToken.endAndStart(Phases.REGISTER_BUNDLED_FONTS);
AppUIUtil.registerBundledFonts();
measureToken.end();
AppUIUtil.showUserAgreementAndConsentsIfNeeded();
@@ -26,6 +26,7 @@ public final class StartUpMeasurer {
public static final String INIT_DEFAULT_LAF = "init default LaF";
public static final String UPDATE_WINDOW_ICON = "update window icon";
public static final String REGISTER_BUNDLED_FONTS = "register bundled fonts";
public static final String CHECK_LICENSE = "check license";
// this phase name is not fully clear - it is time from `IdeaApplication.initApplication` to `IdeaApplication.run`
public static final String INIT_APP = "app initialization";
@@ -177,6 +178,7 @@ public final class StartUpMeasurer {
if (description != null) {
this.description = description;
}
assert end == 0;
end = System.nanoTime();
items.add(this);
}