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?
Update: changed the form to load on another thread and display underneath my splash screen then close. Looks good visually but I die a little inside every time i run it.
Result: Initial startup time is about the same, and the form loads much faster. I still have no idea why though.
I tested the following cases (bear in mind my system is a lot faster than the client systems).
Time to load the form:
484ms - regular load time151ms - second load time651ms - after form preloaded unbound, minimized, not shown on taskbar287ms - after form preloaded unbound, NOT minimized.635ms - after another form with same controls preloaded, not minimized.So the only way to get it loading faster was actually having the form flicker up on the screen briefly.I imagine if I had it databound to something it would drop back to the 151ms. Almost seems like it's JIT'ing but when I ran Ngen on the .exe and controls I didn't see a difference.
Sorry, should have mentioned.. I had previously turned off binary search, it sped up the startup speed quite a bit.
They all have maybe a dozen or two entries except for one combo that has 1000.
It just seems strange that it's only slow the first time the form loads but not after.I'll play around with loading some of the controls on my splash screen.
It's hard to say with limited information. And if your profiler shows no particular hotspots, then it seems like you might just be putting too much into one form.
jeffkov said:-ran a profiler on it. seemed like all the time was spread out over all the controls in InitializeComponent.
Before you mentioned the profiling, my best guess here would have been that the UltraCombo might be causing the problem.By default, UltraCombo searches it's list using a Binary search. This requires it to build a sorted list of values when it is populated the first time or whenever the list changes. This can cause a slight delay in loading the control initially, but gives you a big gain in performance later on when the user is typing into the combo or any time it has to search the list.
But if that were the problem, it would certainly show up on the profile.
How many rows do your UltraCombo controls have?