Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortherzok <marius.ungureanu@xamarin.com>2018-04-24 23:13:42 +0300
committerMarius Ungureanu <teromario@yahoo.com>2018-04-25 10:31:33 +0300
commit0cbd6f987cca7bc765be12d99966091be1d7a031 (patch)
tree52ef1a1ae2d0cbb1a5de14081f51dc8ac270f850
parent7fdcf1e5a1328242b352440c5e811157721e77f3 (diff)
[Perf] Optimize startup by doing MEF composition query on idle
What happens here is that our Composition Catalog uses Mono.Addins behind the scenes to gather all the assemblies to load for composition. On the other hand, that _also_ loads the addins into the current engine. That means that MEF holds the addin lock, so IDE startup is inconsistent across sessions, depending on who gets to hold the lock first. This should fix the startup of the IDE by a big margin
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
index be6d282f6e..4485fdbf9a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
@@ -164,8 +164,6 @@ namespace MonoDevelop.Ide
Counters.Initialization.Trace ("Initializing Runtime");
Runtime.Initialize (true);
- Composition.CompositionManager.InitializeAsync ().Ignore ();
-
IdeApp.Customizer.OnCoreInitialized ();
Counters.Initialization.Trace ("Initializing theme");
@@ -301,6 +299,7 @@ namespace MonoDevelop.Ide
startupTimer.Stop ();
Counters.Startup.Inc (GetStartupMetadata (startupInfo));
+ GLib.Idle.Add (OnIdle);
IdeApp.Run ();
IdeApp.Customizer.OnIdeShutdown ();
@@ -320,6 +319,12 @@ namespace MonoDevelop.Ide
return 0;
}
+ static bool OnIdle ()
+ {
+ Composition.CompositionManager.InitializeAsync ().Ignore ();
+ return false;
+ }
+
static DateTime lastIdle;
static bool lockupCheckRunning = true;