Dashboard Performance With Large Data Sources

This topic lists approaches you can use to improve performance and reduce memory consumption in cases when a dashboard is bound to a large collection of objects.

Note

The Tips listed here are optional. There is no need to use them unless you observe a drop in performance.

Limit the Amount of Objects Loaded in the Dashboard Designer

If you do not need to observe the whole data set when designing the dashboard, you can limit the amount of loaded objects using the DashboardDataProvider.TopReturnedRecordsInDesigner property. To access the DashboardDataProvider object, use the static DashboardsModule.DataProvider property. To change this property value, add the following code to the platform-agnostic module's constructor declared in the Module.cs (Module.vb) file.

using DevExpress.ExpressApp.Dashboards;
// ...
DashboardsModule.DataProvider.TopReturnedRecordsInDesigner = 100;

Disable Automatic Updates in the WinForms Dashboard Designer

When you perform a data-aware operation in the WinForms Dashboard Designer, the dashboard sends a query to a data source and updates itself automatically according to the returned data. Updating the dashboard according to each change can consume a significant amount of time. In this case, you can disable automatic updates and update the dashboard manually when needed (see Automatic and Manual Updates).

Filter Data Using Parameters

When you filter the dashboard data source, the criteria is applied at the server side, which reduces the amount of loaded data. Refer to the following topics to learn how to apply filters.

WinForms:

ASP.NET:

Use the DataView Mode

To retrieve a lightweight read-only list of data records instead of loading the collection of persistent objects, inherit DashboardDataProvider and override the CreateViewService method.

using DevExpress.ExpressApp.Dashboards;
// ...
public class CustomDashboardDataProvider : DashboardDataProvider {
    protected override IObjectDataSourceCustomFillService CreateViewService(IDashboardData dashboardData) {
        if(dashboardData.Title == "Sales Overview") {
            return new DashboardViewDataSourceFillService();
        }
        return base.CreateViewService(dashboardData);
    }
}

Then, register the custom dashboard data provider using the static DashboardsModule.DataProvider property. To change this property's value, add the following code to the platform-agnostic module's constructor declared in the Module.cs (Module.vb) file.

using DevExpress.ExpressApp.Dashboards;
// ...
DashboardsModule.DataProvider = new CustomDashboardDataProvider();

Use the SQL Data Source

You can use the SQL Data Source instead of the XAF Object Data Source when creating a dashboard. In this instance, you will access data directly, bypassing the Object Space and the ORM data layer. In most cases, this will improve the performance. However, your custom logic that is implemented in business classes (e.g., calculated properties) will be ignored. Security System restrictions will be ignored too.

Saving credentials for non-XAF datasources inside dashboards is disabled due to security reasons. You need to manually provide credentials for such datasources (see How to: Provide Credentials for the Dashboards Module when Using External Data Sources).