Skip to main content
A newer version of this page is available. .

Performance Improvement

  • 5 minutes to read

This topic describes concepts that can help you improve your WPF application’s performance.

Common WPF Performance Improvements

DevExpress WPF controls are native WPF controls. You can apply recommendations applicable to all WPF applications to improve their performance.

Refer to the Optimizing WPF Application Performance documentation section to learn more.

JIT Compilation

When you build a .NET application, it is compiled into Microsoft Intermediate Language (MSIL). The “just in time” compiler (JIT-compiler) compiles an application’s MSIL code into machine code when a user launches the application. This process can cause noticeable delays. External DLLs (for example, the DevExpress assemblies) may be loaded in addition to your own application, which means that a delay does not depend on the size of your code alone.

Refer to the following article for details on how to improve your application’s startup time: Reducing the Application Launch Time.

DevExpress Performance Improvements

We are constantly improving the quality and performance of our controls. We recommend that you use newer DevExpress versions.

We also provide optional GridControl optimizations in addition to performance improvements.

Server-Side Data Processing

The following DevExpress Controls support the server-side data processing:

We recommend enabling server-side data processing if the control slows down due to a large number of data records in a bound data source:

  • the control does not process (sort, group, filter, and etc.) loaded items: the database server (or Odata service) processes data items.
  • the control loads only those items it displays on screen.

Lightweight Templates

The following controls include the lightweight templates for their elements to reduce their loading time and improve scrolling performance:

Progress Indicators and Splash Screen

It is recommended to use progress indicators when your application executes time consuming operations. DevExpress ships the following progress indicators:

We recommend that you use the SplashScreen when your application requires much time to run. The SplashScreenManager allows you to display a splash screen immediately after the user starts an application.

Progress indicators and the splash screen cannot improve the application’s performance, but they improve its UX.

See also:

Deferred RibbonPage Content Loading

You can load RibbonPage content when a user opens the page. This will speed up your RibbonControl cold and hot startup times.

This technique works the best when your RibbonControl contains multiple RibbonPages with lots of items, galleries, or other heavy-weight content.

Refer to the following topic for more information: Ribbon Performance Enhancements

Preload Theme Resources

Controls in an application use theme resources (default styles, templates, keys) to change their appearance when you apply a DevExpress WPF Theme to the application.

A WPF application loads a control’s theme resources only when the control is about to be displayed. As a result, consequent windows that rely on DevExpress WPF themes can take longer to appear.

This prolonged display time can be crucial when the first window of your application is lightweight (login form), and the main application window is heavy (contains a massive control\many controls). In this case, the first window is appears quickly, but the second one can take noticeable amount of time to load theme resources.

The PreloadThemeResourceAsync method allows you to speed up the display time of subsequent windows. The method preloads theme resources for the control assemblies that are referenced on these windows. You can use the PreloadThemeResourceAsync method both synchronously and asynchronously.

Refer to the following methods’ remarks for more information: PreloadThemeResourceAsync / PreloadThemeResource.

Asynchronous Theme Resource Preload

How to Use

Asynchronous theme preload works best when the application’s start window is lightweight, like a login form. In this case, you can use the PreloadThemeResourceAsync method to preload theme resources of the second window asynchronously while a user inputs login credentials.

Example

The following code sample creates static constructors and preloads the Office2019Colorful theme resources asynchronously at the application startup.

using System.Windows;
using System.Threading;
using DevExpress.Xpf.Core;

public partial class App : Application {
    protected async override void OnStartup(StartupEventArgs e) {
        base.OnStartup(e);
        await ThemeManager.PreloadThemeResourceAsync("Office2019Colorful");
    }
}
Issues

Asynchronous theme resource preload may slow down resource loading from the UI thread. Refer to the following section to avoid this shortcoming: Use Asynchronous Theme Preload on Dispatcher.

Synchronous Theme Resource Preload

When to Use

This technique works best when you display the Splashscreen Manager at the application startup. In this case, the method loads a control’s theme resources while the Splashscreen is displayed.

Perfromance

Theme preload slows down application startup but speeds up startup of subsequent windows that use preloaded theme resources.

Example

To use synchronous theme preload, use the .Wait() method with the PreloadThemeResource.

The following code sample preloads Data Grid and LayoutControl assemblies while the Splashscreen Manager is displayed:

using System.Windows;
using System.Threading;
using DevExpress.Xpf.Core;
using DevExpress.Xpf.Grid;
using DevExpress.Xpf.Layout;

static Type[] types;
    static App()
    {
        types = new Type[] { typeof(GridControl), typeof(LayoutControl) };
        SplashScreenManager.CreateThemed().ShowOnStartup();
        ThemeManager.PreloadThemeResource("Office2019Colorful");
    }

View Example