I have a program with two forms. The first form has an infragistics toolbar, button, and a couple ultragrids bound to two binding sources and display after my splash screen is closed.
The second form has 7 ultracombo controls, 4 ultradatetimeeditor controls, ultra tab control, 4 textboxes, 3 ultramaskededit controls, 1 ultranumeric editor,ultraspellchecker, and they are all bound to a bindingsource of List<myobject>.
There is a delay on the first form opening, but it is not all that noticeable due to the splash screen. However, the delay on the second screen is very noticeable to the user (about 1 second delay). Enough that it seems like you haven't clicked the button. The second time this form loads, it comes up quickly.
Things I have tried to fix it:
-went through the posts here on performance for wingrids, etc. Set celldisplaystyle to plain text on combo controls. removed auto resizing from ultra combo columns (this helps a lot).
-preload all the infragistics assemblies I am using in my splash screen using System.Reflection.Assembly.Load()
-ran ngen on my app and dependencies (did not seem to make a difference, maybe because of previous item in this list).
-ran a profiler on it. seemed like all the time was spread out over all the controls in InitializeComponent.
-removed all the controls one by one on the form. There was no particular one that was a smoking gun, but if I removed all the editor controls and just left the ultrapanels it got fast again.
Also, I noticed this line the first time the form opened but not after:
Loaded 'C:\Windows\assembly\GAC_MSIL\Infragistics.License\1.0.5005.10__7dd5c3163f2cd0cb\Infragistics.License.dll'
Anyways, I'm stumped. Maybe the ultra combo control is just too 'heavy' to have this many on a page?
Thanks jeffkov,
i'll try.
I run ngen.exe from .net framework directory on all the assemblies on the first run after install. If you have it queue the ngen (which you probably should if it isn't part of your install process) you won't see the speedup the first time you run it.
Make sure you run the ngen.exe from the framework64 directory if you are on a 64 bit machine.
I found it also sped it up a litte bit more to bring up a copy of your window behind your splash screen and then close it while loading, not sure why.
You could also look at preloading assemblies with System.Reflection.Assembly.Load()
Hello,
me too have the same problem. Its slow the first time i load a form.
How did you solve?
thank you.
Thanks for the comment.. I went back and double checked.. I was running the 32 bit version of NGen and the app was running in 64bits so it was having no effect. I ran the 64 bit version of NGen on the app and form opening time dropped down to 300ms. If I preload the form under the splash screen and NGen it dropped to 170ms. So NGen'ing definitely made it faster but there it something else going on as well. Anyways, it's fast enough now. I think I'll leave the popunder form in as well since not all users will have the admin rights necessary to run NGen and clickonce seems to have no provision for automatically elevating it.
Thanks Mike!
The fact that it's so much faster the second time you load the same form is a strong indication that the problem is the JITing of the assemblies. But you are right, if that's the case, using NGen to pre-JIT the asemblies should fix that.