Browse Source

Performance: Initialize ToolPanes in DockWorkspace.InitializeLayout() instead of the property getter to avoid WPF seeing them in InitializeComponent() and rendering all panes docked at the right before the layout is properly initialized. This also appears to make startup around 500ms/25% faster, keeping total time from App::.cctor to "decompilation finished" (for a "standard" assembly node with just attributes in the output) at under two seconds.

pull/3350/head
Siegfried Pammer 5 months ago
parent
commit
663dea45bf
  1. 14
      ILSpy/Docking/DockWorkspace.cs

14
ILSpy/Docking/DockWorkspace.cs

@ -123,11 +123,9 @@ namespace ICSharpCode.ILSpy.Docking @@ -123,11 +123,9 @@ namespace ICSharpCode.ILSpy.Docking
public ReadOnlyObservableCollection<TabPageModel> TabPages { get; }
public ReadOnlyCollection<ToolPaneModel> ToolPanes => exportProvider
.GetExportedValues<ToolPaneModel>("ToolPane")
.OrderBy(item => item.Title)
.ToArray()
.AsReadOnly();
private ToolPaneModel[] toolPanes = [];
public ReadOnlyCollection<ToolPaneModel> ToolPanes => toolPanes.AsReadOnly();
public bool ShowToolPane(string contentId)
{
@ -183,6 +181,12 @@ namespace ICSharpCode.ILSpy.Docking @@ -183,6 +181,12 @@ namespace ICSharpCode.ILSpy.Docking
AddTabPage();
}
toolPanes = exportProvider
.GetExportedValues<ToolPaneModel>("ToolPane")
.OrderBy(item => item.Title)
.ToArray();
OnPropertyChanged(nameof(ToolPanes));
DockingManager.LayoutUpdateStrategy = this;
XmlLayoutSerializer serializer = new XmlLayoutSerializer(DockingManager);
serializer.LayoutSerializationCallback += LayoutSerializationCallback;

Loading…
Cancel
Save