You can use the StopWatch command. Start it and Stop it in certain locations and popup a message box after certain events showing the time. This will help you to start learning where your time loss is.
Just FYI, this is always an issue if you have too many assemblies that need to be loaded at the same time on the same form....but you can overcome this by pre-loading the assemblies. I promise that this works, but you are going to have to expand the code I gave you earlier by making sure any assemblies in the child are loaded as well. That is why it is fast the second time you go in....the assemblies are loaded in the AppDomain.
One thing you can do is cycle through the loaded assemblies in the AppDomain.CurrentDomain before and after the child is loaded. You will see that there are more assemblies loaded after than before. This might help you pinpoint which assemblies you are missing.
Dim loName As System.Reflection.AssemblyName
For Each loName In System.Reflection.Assembly.GetExecutingAssembly().GetReferencedAssemblies() AppDomain.CurrentDomain.Load(loName)Next
I did not test this code, but this should get you going in the right direction.
We have done this a time or two in scenarios when there will be a large number of assemblies that are going to loaded right off the bat. We will create a splash window and show it in the AppMain.vb or program.cs file in the InitApplication method. The splash window has a label and a progress bar showing the whatever text you want and then the progress bar has the max count set to the number of assemblies that are going to be loaded. When then cycle through the references and manually load them into the AppDomain. Generally we close down the splash screen in the Shown event of the first form that appears. So obviously you will want to have a shared class or property that exposes the instance of the splash screen.
Let me know if this doesn't make any sense.
The reason this seems to take a little longer has do with the structure of your assemblies. There is nothing wrong with this approach, but the reason you are seeing a delay more than likely has to do with the fact that the assembly containing the child is being loaded into memory. .NET only loads assemblies as they are needed. Even if you have 100 references to unique assemblies, the referenced assemblied are not loaded into the AppDomain until some class is called or referenced that depended upon that assembly.
If you really want to see where your time delays are happening then you may want to invest in a product such as a .NET Profiler (Red Gate has one) which breaks down each line of code and creates reports telling you exactly where your time delays are occurring.
This is something that we do all of the time, and is common place for most any application. But I am confident your problem here is not in the BO arena but more than likely something else that is taking place when the assembly is loaded.