Bug 14868 - Slow solution load
Summary: Slow solution load
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-09-19 15:56 UTC by Mikayla Hutchinson [MSFT]
Modified: 2013-09-24 23:48 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Mikayla Hutchinson [MSFT] 2013-09-19 15:56:35 UTC
Loading md-addins is very slow, seems to be caused by loading type databases in the GUI thread:

"GUI Thread"  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.IO.MonoIO.Read (intptr,byte[],int,int,System.IO.MonoIOError&) <IL 0x00026, 0xffffffff>
  at System.IO.FileStream.ReadData (intptr,byte[],int,int) [0x00002] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.IO/FileStream.cs:1077
  at System.IO.FileStream.RefillBuffer () [0x00007] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.IO/FileStream.cs:1065
  at System.IO.FileStream.ReadByte () [0x00078] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.IO/FileStream.cs:461
  at System.IO.BinaryReader.ReadByte () [0x00031] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.IO/BinaryReader.cs:314
  at System.IO.BinaryReader.Read7BitEncodedInt () [0x0000b] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.IO/BinaryReader.cs:286
  at ICSharpCode.NRefactory.Utils.BinaryReaderWith7BitEncodedInts.ReadInt32 () [0x00002] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory/Utils/7BitEncodedInts.cs:46
  at ICSharpCode.NRefactory.Utils.FastSerializer.Deserialize (System.IO.BinaryReader) [0x00002] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory/Utils/FastSerializer.cs:860
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.DeserializeObject<T> (string) [0x00043] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:683
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.LoadAssemblyContext (MonoDevelop.Core.FilePath) [0x0009c] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:2123
  at MonoDevelop.Ide.TypeSystem.TypeSystemService/ProjectContentWrapper.ReconnectAssemblyReferences () [0x00189] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:1378
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.ReloadAllReferences (System.Collections.Generic.IEnumerable`1<MonoDevelop.Ide.TypeSystem.TypeSystemService/ProjectContentWrapper>) [0x00016] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:851
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.InternalLoad (MonoDevelop.Projects.WorkspaceItem) [0x000eb] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:831
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.Load (MonoDevelop.Projects.WorkspaceItem) [0x0000e] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:813
  at MonoDevelop.Ide.RootWorkspace.NotifyItemAddedGui (MonoDevelop.Projects.WorkspaceItem,bool) [0x00003] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:1077
  at MonoDevelop.Ide.RootWorkspace.NotifyItemAdded (MonoDevelop.Projects.WorkspaceItem) [0x0002c] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:1064
  at MonoDevelop.Ide.RootWorkspaceItemCollection.InsertItem (int,MonoDevelop.Projects.WorkspaceItem) [0x0001b] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:1493
  at System.Collections.ObjectModel.Collection`1.Add (T) [0x0000c] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.Collections.ObjectModel/Collection.cs:81
  at MonoDevelop.Ide.RootWorkspace/<BackgroundLoadWorkspace>c__AnonStorey9D.<>m__12A (object,System.EventArgs) [0x00012] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:602
  at Gtk.Application/InvokeCB.Invoke () [0x00001] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/Application.cs:202
  at GLib.Timeout/TimeoutProxy.Handler () [0x0000e] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/glib/Timeout.cs:70
  at (wrapper native-to-managed) GLib.Timeout/TimeoutProxy.Handler () <IL 0x0002d, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <IL 0x00022, 0xffffffff>
  at Gtk.Application.Run () [0x00001] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/Application.cs:135
  at MonoDevelop.Ide.IdeApp.Run () [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:387
  at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions) [0x007b8] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:295
  at MonoDevelop.Ide.IdeStartup.Main (string[]) [0x00086] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:541
  at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:17
Comment 1 Mike Krüger 2013-09-20 05:09:25 UTC
I can't find a timing problem here. 

The stack trace shows reading assembly descriptors - that's reading around 300 bytes for each assembly reference containing some metadata.

However I could optimize away the assembly descriptors - I thought that I could put some useful data there, but it was just the 'write time' of the dll which got used - this information can be placed as write time of the assembly description.

The real type 'serialization' (no we don't have databases anymore) isn't done on the ui thread and for me solution load hasn't improved by a visible margin (but anyways - there was room for improvement :))
Comment 2 Mikayla Hutchinson [MSFT] 2013-09-20 16:25:03 UTC
The solution load bottleneck for me still seems to be TypeSystemService doing heavy disk IO in the UI thread.

Do you have a SSD? :)

"GUI Thread"  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.IO.MonoIO.FindNext (intptr,System.IO.FileAttributes&,System.IO.MonoIOError&) <IL 0x00023, 0xffffffff>
  at System.IO.Directory/<EnumerateKind>c__Iterator11.MoveNext () [0x00129] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/corlib/System.IO/Directory.cs:550
  at System.Linq.Enumerable/<CreateWhereIterator>c__Iterator33`1.MoveNext () [0x0006f] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/System.Core/System.Linq/Enumerable.cs:3120
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.InternalGetCacheDirectory (MonoDevelop.Core.FilePath) [0x000d0] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:526
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.GetCacheDirectory (string,bool) [0x00029] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:569
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.CheckModifiedFile (MonoDevelop.Ide.TypeSystem.TypeSystemService/UnresolvedAssemblyProxy) [0x00009] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:2615
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.LoadAssemblyContext (MonoDevelop.Core.FilePath) [0x00021] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:2115
  at MonoDevelop.Ide.TypeSystem.TypeSystemService/ProjectContentWrapper.ReconnectAssemblyReferences () [0x00189] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:1378
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.ReloadAllReferences (System.Collections.Generic.IEnumerable`1<MonoDevelop.Ide.TypeSystem.TypeSystemService/ProjectContentWrapper>) [0x00016] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:851
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.InternalLoad (MonoDevelop.Projects.WorkspaceItem) [0x000eb] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:831
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.Load (MonoDevelop.Projects.WorkspaceItem) [0x0000e] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:813
  at MonoDevelop.Ide.RootWorkspace.NotifyItemAddedGui (MonoDevelop.Projects.WorkspaceItem,bool) [0x00003] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:1077
  at MonoDevelop.Ide.RootWorkspace.NotifyItemAdded (MonoDevelop.Projects.WorkspaceItem) [0x0002c] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:1064
  at MonoDevelop.Ide.RootWorkspaceItemCollection.InsertItem (int,MonoDevelop.Projects.WorkspaceItem) [0x0001b] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:1493
  at System.Collections.ObjectModel.Collection`1.Add (T) [0x0000c] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/corlib/System.Collections.ObjectModel/Collection.cs:81
  at MonoDevelop.Ide.RootWorkspace/<BackgroundLoadWorkspace>c__AnonStorey9D.<>m__12A (object,System.EventArgs) [0x00012] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:602
  at Gtk.Application/InvokeCB.Invoke () <IL 0x00012, 0x0001d>
  at GLib.Timeout/TimeoutProxy.Handler () <IL 0x0000d, 0x00031>
  at (wrapper native-to-managed) GLib.Timeout/TimeoutProxy.Handler () <IL 0x0002d, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <IL 0x00022, 0xffffffff>
  at Gtk.Application.Run () <IL 0x00000, 0x0000b>
  at MonoDevelop.Ide.IdeApp.Run () [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:387
  at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions) [0x007b8] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:295
  at MonoDevelop.Ide.IdeStartup.Main (string[]) [0x00086] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:541
  at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:17
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <IL 0x0005c, 0xffffffff>
Comment 3 Mikayla Hutchinson [MSFT] 2013-09-20 16:49:19 UTC
I get the same trace during a 5s hang when removing references:

"GUI Thread"  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.IO.MonoIO.FindNext (intptr,System.IO.FileAttributes&,System.IO.MonoIOError&) <IL 0x00023, 0xffffffff>
  at System.IO.Directory/<EnumerateKind>c__Iterator11.MoveNext () [0x00129] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.IO/Directory.cs:550
  at System.Linq.Enumerable/<CreateWhereIterator>c__Iterator33`1.MoveNext () [0x0006f] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/System.Core/System.Linq/Enumerable.cs:3120
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.InternalGetCacheDirectory (MonoDevelop.Core.FilePath) [0x000d0] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:526
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.GetCacheDirectory (string,bool) [0x00029] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:569
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.CheckModifiedFile (MonoDevelop.Ide.TypeSystem.TypeSystemService/UnresolvedAssemblyProxy) [0x00009] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:2615
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.LoadAssemblyContext (MonoDevelop.Core.FilePath) [0x00021] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:2115
  at MonoDevelop.Ide.TypeSystem.TypeSystemService/ProjectContentWrapper.ReconnectAssemblyReferences () [0x0010a] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:1363
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.ReloadAllReferences (System.Collections.Generic.IEnumerable`1<MonoDevelop.Ide.TypeSystem.TypeSystemService/ProjectContentWrapper>) [0x00016] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:851
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.OnProjectModified (object,MonoDevelop.Projects.SolutionItemModifiedEventArgs) [0x0005d] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:1509
  at (wrapper delegate-invoke) <Module>.invoke_void__this___object_SolutionItemModifiedEventArgs (object,MonoDevelop.Projects.SolutionItemModifiedEventArgs) <IL 0x00059, 0x00072>
  at (wrapper delegate-invoke) <Module>.invoke_void__this___object_SolutionItemModifiedEventArgs (object,MonoDevelop.Projects.SolutionItemModifiedEventArgs) <IL 0x00059, 0xffffffff>
  at MonoDevelop.Projects.SolutionItem.OnModified (MonoDevelop.Projects.SolutionItemModifiedEventArgs) [0x0001f] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs:917
  at MonoDevelop.Projects.SolutionItem.NotifyModified (string) [0x00020] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs:905
  at MonoDevelop.Projects.DotNetProject.NotifyReferenceRemovedFromProject (MonoDevelop.Projects.ProjectReference) [0x00007] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs:1108
  at MonoDevelop.Projects.DotNetProject.OnItemsRemoved (System.Collections.Generic.IEnumerable`1<MonoDevelop.Projects.ProjectItem>) [0x0002b] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs:1102
  at MonoDevelop.Projects.ProjectItemCollection`1.NotifyRemoved (System.Collections.Generic.IEnumerable`1<MonoDevelop.Projects.ProjectItem>,bool) [0x000a8] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemCollection.cs:180
  at MonoDevelop.Projects.ProjectItemCollection`1.MonoDevelop.Projects.IItemListHandler.InternalRemove (System.Collections.Generic.IEnumerable`1<MonoDevelop.Projects.ProjectItem>,bool) [0x00041] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemCollection.cs:146
  at MonoDevelop.Projects.ProjectItemCollection`1.NotifyRemoved (System.Collections.Generic.IEnumerable`1<MonoDevelop.Projects.ProjectItem>,bool) [0x00091] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemCollection.cs:178
  at MonoDevelop.Projects.ProjectItemCollection`1.OnItemRemoved (T) [0x0001b] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemCollection.cs:130
  at MonoDevelop.Projects.ItemCollection`1.RemoveItem (int) [0x00012] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemCollection.cs:46
  at System.Collections.ObjectModel.Collection`1.Remove (T) [0x00011] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.Collections.ObjectModel/Collection.cs:134
  at MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectReferenceNodeCommandHandler.DeleteMultipleItems () [0x00049] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs:148
  at MonoDevelop.Ide.Gui.Components.NodeCommandHandler.DeleteCurrentItem () [0x00002] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs:137
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <IL 0x0004e, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <IL 0x00030, 0xffffffff>
  at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x00054] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
  at System.Reflection.MethodBase.Invoke (object,object[]) [0x00000] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.Reflection/MethodBase.cs:114
  at MonoDevelop.Components.Commands.DefaultCommandHandler.Run (object,MonoDevelop.Components.Commands.Command) [0x00019] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:2094
  at MonoDevelop.Components.Commands.CustomCommandTargetAttribute.Run (object,MonoDevelop.Components.Commands.Command) [0x00009] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CustomCommandTargetAttribute.cs:101
  at MonoDevelop.Ide.Gui.Components.NodeCommandHandler/TransactedNodeHandlerAttribute.Run (object,MonoDevelop.Components.Commands.Command) [0x0002d] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs:296
  at MonoDevelop.Components.Commands.CustomCommandTargetAttribute.MonoDevelop.Components.Commands.ICommandTargetHandler.Run (object,MonoDevelop.Components.Commands.Command) [0x00004] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CustomCommandTargetAttribute.cs:58
  at MonoDevelop.Components.Commands.CommandHandlerInfo.Run (object,MonoDevelop.Components.Commands.Command) [0x00021] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1963
  at MonoDevelop.Components.Commands.CommandManager/<DispatchCommand>c__AnonStorey80.<>m__CD () [0x0005f] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1054
  at MonoDevelop.Components.Commands.CommandManager.DispatchCommand (object,object,object,MonoDevelop.Components.Commands.CommandSource) [0x002b0] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1071
  at MonoDevelop.Components.Commands.CommandMenuItem.OnActivated () [0x00079] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs:131
  at Gtk.MenuItem.activated_cb (intptr) [0x0000f] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/generated/MenuItem.cs:238
  at (wrapper native-to-managed) Gtk.MenuItem.activated_cb (intptr) <IL 0x00021, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <IL 0x00022, 0xffffffff>
  at Gtk.Application.Run () [0x00001] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/Application.cs:135
  at MonoDevelop.Ide.IdeApp.Run () [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:387
  at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions) [0x007b8] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:295
  at MonoDevelop.Ide.IdeStartup.Main (string[]) [0x00086] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:541
  at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:17
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <IL 0x0005c, 0xffffffff>
Comment 4 Mike Krüger 2013-09-21 00:54:52 UTC
Y I have a SSD - but with the current project system I can't move everything in a BG thread - we have some limitations and doing things in the GUI thread is the result.

However maybe it's possible to optimize the 'remove references' operation - but the general problem would remain. I'll look at this operation.
Comment 5 Mike Krüger 2013-09-21 00:58:28 UTC
A working file system watcher would help too btw.

Can you give me some timings for your system ? I would be really interrested how long the "OnProjectModified" handler takes on your system.
Comment 6 Mike Krüger 2013-09-21 03:45:23 UTC
5s sounds not realistic for this operation (even with reading the 300 byte files) - even if you would've but it on an USB hard disk I can't believe that the check takes so long.

I bet that the completion db gets loaded fully on the ui thread caused by some side effect and that the GUI thread waits for that somewhere - I'll look into that.
Comment 7 Mike Krüger 2013-09-23 03:44:11 UTC
There were multiple issues. But the biggest one seemed to be the 

DotNetProject.GetReferencedAssemblies - that's very slow. I now restructured it to a lazy loading system and don't do the building of the type system connections in the gui thread.

But we need to test it for a while.
Comment 8 Mikayla Hutchinson [MSFT] 2013-09-23 15:46:04 UTC
It's definitely better, though stetic is de-lazying it:

"GUI Thread"  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.IO.MonoIO.GetFileAttributes (string,System.IO.MonoIOError&) <IL 0x00022, 0xffffffff>
  at System.IO.MonoIO.ExistsFile (string,System.IO.MonoIOError&) [0x00000] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.IO/MonoIO.cs:233
  at System.IO.File.Exists (string) [0x0002a] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.IO/File.cs:185
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.CheckCacheDirectoryIsCorrect (MonoDevelop.Core.FilePath,MonoDevelop.Core.FilePath,string&) [0x00050] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:609
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.InternalGetCacheDirectory (MonoDevelop.Core.FilePath) [0x000ba] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:521
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.GetCacheDirectory (string,bool) [0x00029] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:564
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.LoadAssemblyContext (MonoDevelop.Core.FilePath) [0x0007b] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:2100
  at MonoDevelop.Ide.TypeSystem.TypeSystemService/ProjectContentWrapper.ReconnectAssemblyReferences () [0x00189] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:1417
  at MonoDevelop.Ide.TypeSystem.TypeSystemService/ProjectContentWrapper.get_Content () [0x00015] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:930
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.ParseFile (MonoDevelop.Projects.Project,string,string,System.IO.TextReader) [0x0009f] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:385
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.ParseFile (MonoDevelop.Projects.Project,string,string,string) [0x0000c] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:419
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.ParseFile (MonoDevelop.Projects.Project,string) [0x00033] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:361
  at MonoDevelop.GtkCore.GuiBuilder.GuiBuilderDisplayBinding.GetWindow (string) [0x000a3] in /Users/michael/Mono/monodevelop/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:96
  at MonoDevelop.GtkCore.GuiBuilder.GuiBuilderDisplayBinding.CanHandle (MonoDevelop.Core.FilePath,string,MonoDevelop.Projects.Project) [0x0002c] in /Users/michael/Mono/monodevelop/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:57
  at MonoDevelop.Ide.Gui.DisplayBindingService/<GetDisplayBindings>c__Iterator1.MoveNext () [0x000a4] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DisplayBindingService.cs:54
  at System.Linq.Enumerable/<CreateWhereIterator>c__Iterator33`1.MoveNext () [0x0006f] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/System.Core/System.Linq/Enumerable.cs:3120
  at System.Linq.Enumerable/<CreateOfTypeIterator>c__Iterator21`1.MoveNext () [0x00069] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/System.Core/System.Linq/Enumerable.cs:2157
  at System.Linq.Enumerable.First<TSource> (System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource, bool>,System.Linq.Enumerable/Fallback) [0x0001f] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/System.Core/System.Linq/Enumerable.cs:813
  at System.Linq.Enumerable.FirstOrDefault<TSource> (System.Collections.Generic.IEnumerable`1<TSource>) [0x00006] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/System.Core/System.Linq/Enumerable.cs:855
  at MonoDevelop.Ide.Gui.Workbench.RealOpenFile (MonoDevelop.Core.IProgressMonitor,MonoDevelop.Ide.Gui.FileOpenInformation) [0x0020d] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:856
  at MonoDevelop.Ide.Gui.Workbench.BatchOpenDocument (MonoDevelop.Core.IProgressMonitor,MonoDevelop.Core.FilePath,MonoDevelop.Projects.Project,int,int) [0x00058] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:517
  at MonoDevelop.Ide.Gui.Workbench.OnLoadingWorkspaceUserPreferences (object,MonoDevelop.Ide.UserPreferencesEventArgs) [0x00108] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:955
  at (wrapper delegate-invoke) System.EventHandler`1.invoke_void__this___object_TEventArgs (object,TEventArgs) <IL 0x00059, 0xffffffff>
  at MonoDevelop.Ide.RootWorkspace.RestoreWorkspacePreferences (MonoDevelop.Projects.WorkspaceItem) [0x000fd] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:775
  at MonoDevelop.Ide.RootWorkspace/<BackgroundLoadWorkspace>c__AnonStorey9D.<>m__12A (object,System.EventArgs) [0x00071] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:628
  at Gtk.Application/InvokeCB.Invoke () [0x00001] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/Application.cs:202
  at GLib.Timeout/TimeoutProxy.Handler () [0x0000e] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/glib/Timeout.cs:70
  at (wrapper native-to-managed) GLib.Timeout/TimeoutProxy.Handler () <IL 0x0002d, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <IL 0x00022, 0xffffffff>
  at Gtk.Application.Run () [0x00001] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/Application.cs:135
  at MonoDevelop.Ide.IdeApp.Run () [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:387
  at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions) [0x007b8] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:295
  at MonoDevelop.Ide.IdeStartup.Main (string[]) [0x00086] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:541
  at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:17
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <IL 0x0005c, 0xffffffff>
Comment 9 Mikayla Hutchinson [MSFT] 2013-09-23 15:50:32 UTC
And the unit test editor extension:

"GUI Thread"  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.IO.MonoIO.FindNext (intptr,System.IO.FileAttributes&,System.IO.MonoIOError&) <IL 0x00023, 0xffffffff>
  at System.IO.Directory/<EnumerateKind>c__Iterator11.MoveNext () [0x00129] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.IO/Directory.cs:550
  at System.Linq.Enumerable/<CreateWhereIterator>c__Iterator33`1.MoveNext () [0x0006f] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/System.Core/System.Linq/Enumerable.cs:3120
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.InternalGetCacheDirectory (MonoDevelop.Core.FilePath) [0x000d0] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:520
  at MonoDevelop.Ide.TypeSystem.TypeSystemService.GetCacheDirectory (string,bool) [0x00029] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs:564
  at MonoDevelop.NUnit.RootTest.GetTestResultsDirectory (string) [0x00003] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Project/NUnitAssemblyGroupProject.cs:147
  at MonoDevelop.NUnit.SolutionFolderTestGroup..ctor (MonoDevelop.Projects.SolutionFolder) [0x00020] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/SolutionFolderTestGroup.cs:47
  at MonoDevelop.NUnit.SolutionFolderTestGroup.CreateTest (MonoDevelop.Projects.SolutionFolder) [0x00002] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/SolutionFolderTestGroup.cs:58
  at MonoDevelop.NUnit.SystemTestProvider.CreateUnitTest (MonoDevelop.Projects.IWorkspaceObject) [0x0000e] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/SystemTestProvider.cs:42
  at MonoDevelop.NUnit.NUnitService.BuildTest (MonoDevelop.Projects.IWorkspaceObject) [0x00023] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/NUnitService.cs:285
  at MonoDevelop.NUnit.SolutionFolderTestGroup.OnCreateTests () [0x00028] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/SolutionFolderTestGroup.cs:85
  at MonoDevelop.NUnit.UnitTestGroup.get_Tests () [0x0001a] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/UnitTestGroup.cs:66
  at MonoDevelop.NUnit.UnitTestGroup.get_HasTests () [0x00003] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/UnitTestGroup.cs:51
  at MonoDevelop.NUnit.SystemTestProvider.CreateUnitTest (MonoDevelop.Projects.IWorkspaceObject) [0x00089] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/SystemTestProvider.cs:53
  at MonoDevelop.NUnit.NUnitService.BuildTest (MonoDevelop.Projects.IWorkspaceObject) [0x00023] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/NUnitService.cs:285
  at MonoDevelop.NUnit.SolutionFolderTestGroup.OnCreateTests () [0x00028] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/SolutionFolderTestGroup.cs:85
  at MonoDevelop.NUnit.UnitTestGroup.get_Tests () [0x0001a] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/UnitTestGroup.cs:66
  at MonoDevelop.NUnit.UnitTestGroup.get_HasTests () [0x00003] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/UnitTestGroup.cs:51
  at MonoDevelop.NUnit.SystemTestProvider.CreateUnitTest (MonoDevelop.Projects.IWorkspaceObject) [0x00089] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/SystemTestProvider.cs:53
  at MonoDevelop.NUnit.NUnitService.BuildTest (MonoDevelop.Projects.IWorkspaceObject) [0x00023] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/NUnitService.cs:285
  at MonoDevelop.NUnit.NUnitService.RebuildTests () [0x0005e] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/NUnitService.cs:272
  at MonoDevelop.NUnit.NUnitService.get_Instance () [0x0001b] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Services/NUnitService.cs:67
  at MonoDevelop.NUnit.TestPad..ctor () [0x00001] in /Users/michael/Mono/monodevelop/main/src/addins/NUnit/Gui/TestPad.cs:51
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <IL 0x0004e, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) <IL 0x00030, 0xffffffff>
  at System.Reflection.MonoCMethod.InternalInvoke (object,object[]) [0x00002] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System.Reflection/MonoMethod.cs:537
  at System.Activator.CreateInstance (System.Type,bool) [0x000af] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-None/mcs/class/corlib/System/Activator.cs:329
  at Mono.Addins.RuntimeAddin.CreateInstance (string,bool) [0x00017] in /Users/michael/Mono/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/RuntimeAddin.cs:431
  at MonoDevelop.Ide.Codons.SolutionPadCodon.CreatePad () [0x0004d] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/SolutionPadCodon.cs:84
  at MonoDevelop.Ide.Codons.PadCodon.InitializePadContent (MonoDevelop.Ide.Gui.IPadWindow) [0x0000f] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs:93
  at MonoDevelop.Ide.Gui.PadWindow.CreateContent () [0x00015] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs:276
  at MonoDevelop.Ide.Gui.PadWindow.get_Content () [0x00002] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs:161
  at MonoDevelop.Ide.Gui.Pad.get_Content () [0x00007] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Pad.cs:61
  at MonoDevelop.CSharp.UnitTestTextEditorExtension.Initialize () [0x00045] in /Users/michael/Mono/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/UnitTestTextEditorExtension.cs:58
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.Initialize (MonoDevelop.Ide.Gui.Document) [0x0001f] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:50
  at MonoDevelop.Ide.Gui.Document.InitializeExtensionChain () [0x000b1] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs:634
  at MonoDevelop.Ide.Gui.Document.InitializeEditor (MonoDevelop.Ide.Gui.Content.IExtensibleTextEditor) [0x0008e] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs:678
  at MonoDevelop.Ide.Gui.Document.OnDocumentAttached () [0x00011] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs:685
  at MonoDevelop.Ide.Gui.Workbench.WrapDocument (MonoDevelop.Ide.Gui.IWorkbenchWindow) [0x0005b] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:699
  at MonoDevelop.Ide.Gui.ViewCommandHandlers..ctor (MonoDevelop.Ide.Gui.IWorkbenchWindow) [0x00015] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:49
  at MonoDevelop.Ide.Gui.SdiWorkspaceWindow..ctor (MonoDevelop.Ide.Gui.DefaultWorkbench,MonoDevelop.Ide.Gui.IViewContent,MonoDevelop.Ide.Gui.DockNotebook,MonoDevelop.Ide.Gui.IDockNotebookTab) [0x00176] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:107
  at MonoDevelop.Ide.Gui.DefaultWorkbench.ShowView (MonoDevelop.Ide.Gui.IViewContent,bool) [0x000e6] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:396
  at MonoDevelop.Ide.Gui.LoadFileWrapper.Invoke (string) [0x001f4] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:1299
  at MonoDevelop.Ide.Gui.Workbench.RealOpenFile (MonoDevelop.Core.IProgressMonitor,MonoDevelop.Ide.Gui.FileOpenInformation) [0x0029f] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:873
  at MonoDevelop.Ide.Gui.Workbench.BatchOpenDocument (MonoDevelop.Core.IProgressMonitor,MonoDevelop.Core.FilePath,MonoDevelop.Projects.Project,int,int) [0x00058] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:517
  at MonoDevelop.Ide.Gui.Workbench.OnLoadingWorkspaceUserPreferences (object,MonoDevelop.Ide.UserPreferencesEventArgs) [0x00108] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:955
  at (wrapper delegate-invoke) System.EventHandler`1.invoke_void__this___object_TEventArgs (object,TEventArgs) <IL 0x00059, 0xffffffff>
  at MonoDevelop.Ide.RootWorkspace.RestoreWorkspacePreferences (MonoDevelop.Projects.WorkspaceItem) [0x000fd] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:775
  at MonoDevelop.Ide.RootWorkspace/<BackgroundLoadWorkspace>c__AnonStorey9D.<>m__12A (object,System.EventArgs) [0x00071] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:628
  at Gtk.Application/InvokeCB.Invoke () [0x00001] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/Application.cs:202
  at GLib.Timeout/TimeoutProxy.Handler () [0x0000e] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/glib/Timeout.cs:70
  at (wrapper native-to-managed) GLib.Timeout/TimeoutProxy.Handler () <IL 0x0002d, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <IL 0x00022, 0xffffffff>
  at Gtk.Application.Run () [0x00001] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/gtk-sharp-2-12-branch/gtk/Application.cs:135
  at MonoDevelop.Ide.IdeApp.Run () [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:387
  at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions) [0x007b8] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:295
  at MonoDevelop.Ide.IdeStartup.Main (string[]) [0x00086] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:541
  at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:17
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <IL 0x0005c, 0xffffffff>
Comment 10 Mikayla Hutchinson [MSFT] 2013-09-23 17:20:59 UTC
Here's an interesting question though - why does "GetCacheDirectory" always show up in my traces?

I suspect part of the problem is that the EnumerateDirectories is much more expensive than you think. I have over 2000 directories in that directory - and lots of duplicates for common files like mscorlib, due to PCL. I did a test of how long is spent in the EnumerateDirectories loop when loading the MD solution on my system: https://gist.github.com/mhutch/3a81dcd639d8e82e93f2

These add up to 3872 ms, i.e. almost 4 seconds.

I imagine any of the following would improve it:
* reduce collisions by using a hash of the full path instead of the actual name? 
* using subdirectories?
* using an index file?
* explicitly iterating though number instead of enumerating all directories?
Comment 11 Mikayla Hutchinson [MSFT] 2013-09-23 17:25:36 UTC
Possible solution: https://gist.github.com/a2805d60485721e35427

Uses string hashes to reduce collisions, and uses nesting to reduce the enumeration cost when collisions do occur. May break if string hashcodes change, I guess we should really do our own string hashing...

I think we can consider the other problems to be issues in the stetic/nunit addins.
Comment 12 Mikayla Hutchinson [MSFT] 2013-09-23 17:46:01 UTC
Okay, using my patch and disabling nunit editor integration and stetic locally, it seems pretty good :)

Some weirdness in the lazy initialization after nuking the cache directory. For example, opening md-addins, with AccountDialog.cs in Xamarin.Components.Ide open, the members on XWT types were shown as missing until I opened a file in the XWT project.
Comment 13 Mike Krüger 2013-09-24 00:19:33 UTC
I still work with a disabled stetic - it regenerates the gui files too often.
Comment 14 Mike Krüger 2013-09-24 23:48:49 UTC
Should've been fixed (except stetic - but the nunit editor integration doesn't force load as side effect anymore)