2

I develop a C# WPF application using DevExpress controls. I have a DXRibbonWindow as mainwindow which includes several complex usercontrols.

My problem is that the InitializeComponent() method of the mainwindow takes up to 9 seconds to finish. So the application startup takes too long for our customers.

I already tried to initialize each single usercontrol not until it is shown on screen. This way reduce the time of InitializeComponent() heavily about 7 seconds, but in code behind i sometimes need to get access to the controls. Therefore the application throw NullReference exceptions.

Is there any other effective way to improve the initialization of my application?

Kimbo
  • 29
  • 1
  • 5
  • Are you running in debug mode? Look at your output window, if you see a lot of messages there, then this is the cause for the slow down. It will be fast in `Release` mode – thumbmunkeys Sep 15 '15 at 12:53
  • If the previous comment is not the source of your problem. You might consider looking if you have some action taken on load of some of your items. It might be slowing you down a lot. Unless your application is REALLY REALLY big and heavy on background image and stuff i don't see how you could take 9 second of loading. – Daneau Sep 15 '15 at 13:00
  • Either show a loading screen while you do initialization work, or throw off init work onto the Dispatcher at a low priority while showing that loading is happening in the UI (e.g., priority bindings) –  Sep 15 '15 at 13:13
  • 2
    In my experience, DevExpress WPF is extremely slow. Other than that, check for non virtualized ItemsControls (such as putting a DXGrid inside a vertical StackPanel or inside a Grid with `` – Federico Berasategui Sep 15 '15 at 14:24
  • Curious is that the exceptions are only thrown if native code debugging is enabled. There is no performance difference between debug and release assemblys. The program which takes 9 seconds to start is a x86 release assembly of our customer. Additionally the assembly is installed in GAC and optimized with NGEN. – Kimbo Sep 16 '15 at 06:26
  • We show a splash screen while loading but it is more comfortable when the application takes less time too start. Yeah DevExpress WPF tends to be very slow. Is maybe using MVVM design pattern to reduce the initialize component time? – Kimbo Sep 16 '15 at 06:33
  • Does this answer your question? [Performance problem loading lots of user controls](https://stackoverflow.com/questions/4636070/performance-problem-loading-lots-of-user-controls) – StayOnTarget Sep 15 '22 at 19:30

0 Answers0