Search This Blog

Showing posts with label performance. Show all posts
Showing posts with label performance. Show all posts

Wednesday, February 7, 2018

Faster opening of a DetailView with lots of items - XAF WinForms v17.2.6

How big is the DetailView in the question? 
Well, in the T581043 ticket's test project, there are 250 editors in the detail form layout. Big enough, huh?

FreeImages.com/Marcello eM


How much we could speed it up? 
On our powerful test machines, the time to open DetailView with just plain editors (no layout groups or tabs) has dropped from 3 seconds to almost 1. In real world applications, time to open a detail view depends on the application configuration (controllers, data, collection properties, calculated fields) and deployment specifics.

If you cannot wait for the next maintenance update (v17.2.6), install this night buildDevExpressNETComponents-17.2.exe

My team and I would be interested in hearing whether it is something you and your clients will notice too or if there are any problems with that new build. Thanks in advance.

Regards,
Dennis

P.S. If you already migrated to XAF v17.2, make sure you set XafApplication > OptimizedControllersCreation to True as well (read the prerequisites in the docs, first). The How to measure and improve the application's performance article may also help your app perform faster (magically, just after looking at it😜), so check it as well in case of problems in other scenarios.

Wednesday, November 15, 2017

Database maintenance recommendations for applications created or used with XPO or XAF

We have published a KB article that may help you protect the end application's data and keep the system reliable, fast and running smoothly as time goes on, application data grows and other factors are involved during the application's use in production:

https://www.devexpress.com/kb=T572322


FreeImages.com/Sebastian Danon


I hope you find this information helpful.

See Also:
How to measure and improve the application's performance

Friday, July 14, 2017

Controller creation performance optimization v17.2 Preview - YOUR FEEDBACK IS NEEDED!

Starting with version 17.2, we've further optimized the process of creating Controllers that should positively affect forms loading performance and thus overall end user experience, especially in very complex detail forms.  In addition to List Property Editors (learn more about v17.1 improvements in this regard), Detail, Object and Lookup Property Editors, DashboardViewItem and popup windows created in a special way were supported. We are publishing this KB article prior to the 17.2 release to collect early user feedback and improve the overall stability:





If you are an active v17.1 subscriber and want to test this feature with your real world applications on a virtual machine (or another suitable test environment) prior to the official release, please leave a comment to this KB article or rather create a separate private ticket, so that we can verify your account and provide you with a v17.2 preview installation privately.

We would appreciate your thoughts and feedback once you've had the opportunity to try this new feature in your upgraded v17.2 project. Please report any issues and suggestions in our Support Center. Thanks for your help in advance!






Tuesday, June 20, 2017

Performance tuning of the saving/validation process using the PersistenceValidationController events

Regardless of how good and sophisticated your development tools are, real production use often imposes research and solving speed issues. In this tip, I will talk about tuning the Validation Module to do its best when saving a master object exposing  large collections of aggregated data. 

By default, aggregated objects are considered to be an integral part of a master object, and thus, they should be validated together with the master object, which may take significant time if you have hundreds or thousands of complex detail records. The entire detail collection will be loaded and validated in this instance.

The good news is that XAF is very flexible and has a customizable framework that provides many ways to intercept this validation process. 

Thursday, May 25, 2017

Improved ASPxGridListEditor performance when selecting records in the grid control


Starting with version 16.2.7, we improved the selection behavior of ASPxGridListEditor. Currently, ASPxGridView does not re-render itself when selection is changed. 

See screenshots of the Network tab in Chrome Developer Tools (F12) that demonstrates how the size and time of a response in the Opportunity_ListView of the XCRM demo is reduced. The size and time of a response is reduced about 4 times and 35% respectively.

v16.2.7, 17.1.3+












v16.2.6 and lower



Thursday, April 20, 2017

The Frame.GetController method may return null when the XafApplication.OptimizedControllersCreation property is set to True

With XAF v17.1Solution Wizard sets the XafApplication.OptimizedControllersCreation property to True for newly created XAF projects (existing projects will not be affected). 

To avoid possible null reference exceptions in nested List Views, always check if the Frame.GetController<ControllerType> method result is not null when the OptimizedControllersCreation property is true. The latter option is required to get faster loading of DetailView when it contains a lot of nested ListView items (learn more...).

Our online documentation was already updated to describe this optimization specificity and add these null-checks everywhere; e.g., check theses examples: onetwo. KB articles, Code Examples and popular Support Center tickets are not yet updated, but we hope to do this with time as well. Should you find missing checks in our learning materials, please contact us.

FreeImages.com/Christian Kitazume

Friday, March 24, 2017

Faster opening of DetailView with many visible ListPropertyEditors (not in tabs) in complex XAF solutions with lots of Controllers - YOUR FEEDBACK IS NEEDED!

What is behind this optimization? 


With XAF v17.1, we have introduced some optimizations with regard to Controller creation for a Frame inside ListPropertyEditor, which is usually used to represent associated detail collections. That main idea behind this optimization is filtering out certain Controllers by their TargetXXX properties and not creating them at all .On our test machines, which are often multi-core i7 monsters with 16GB ROM, the loading time after this optimization was cut on 0.2-0.3 seconds or on 20% depending on the view configuration (we expect double time on your real client machines with budget i3-i5 or lower CPUs).

Specially for early testing 1-2 months prior to the official release, we have introduced a feature toggle in the current XAF v16.2 and showing this feature there as a preview


When should I be interested in this?


You can skip this post if you do not have many custom Controllers in your apps, because the effect of our optimization will unlikely be noticeable in your case.

You must definitely read further if you have hundreds of own Controllers + use third-party modules like Xafari/eXpand with many custom Controllers in them.

Another condition is DetailView layout configuration, which I would rather clarify with a couple screenshots:



If you have the A configuration, you will NOT benefit much from the optimization we introduced, because there is only one visible ListPropertyEditor in the active tab that affect the overall parent DetailView opening. 

If you have the B configuration, you have several visible ListPropertyEditors that require creating Controllers for their nested Frames immediately with the opening of the parent DetailView and thus slow things down a little. You can either turn our optimization on or consider hiding these ListPropertyEditors behind the tabbed group.

How do I test this right now?

Please download the latest  DevExpressComponents-16.2.5.17082.exe build and set the new XafApplication.OptimizedControllersCreation property to True in the constructor of your XafApplication descendant located in the YourSolutionName.Wxx/WxxApplication.xx file (or in the YourSolutionName.Win/Program.xx or YourSolutionName.Web/Global.asax.xx files), e.g. as follows:

namespace MainDemo.Win {
public partial class MainDemoWinApplication : WinApplication {
public MainDemoWinApplication() {
InitializeComponent();
                        this.OptimizedControllersCreation = true;
}

Tuesday, March 14, 2017

XAF app performance: Reducing the number of simultaneous database connections



Multiple simultaneously opened connections consume your database server memory and thus, have negative impact on your application performance. To diagnose this situation, you can use the following SQL script:

SELECT 
    DB_NAME(dbid) as DBName, 
    COUNT(dbid) as NumberOfConnections,
    loginame as LoginName
FROM
    sys.sysprocesses
WHERE 
    dbid > 0
GROUP BY 
    dbid, loginame

Thankfully, there is a couple of tricks to optimize your existing apps in production (they are already applied out of the box in new projects).


Thursday, March 2, 2017

ASPxGridView/ASPxGridListEditor + Server Mode + Select All = ?

I want to pay your attention to this Support Center ticket describing a recent fix for our ASPxGridListEditor, which is a wrapper over the ASPxGridView component as you know.

It is a known and pretty logical Server Mode limitation that the selection of ALL grid rows using the built-in SelectAll check box is NOT supported in this mode. That is because this particular operation defeats all server mode benefits = causes loading the whole data source into the web server memory...

Our ASPxGridListEditor did not manage the "Select All" header cell visibility prior to v16.2.4. We have corrected this mistake and now this button is hidden in server mode by default (SelectAllCheckboxMode = None). The "Select All" button is still available in Client and DataView modes only (SelectAllCheckboxMode = AllPages), though.


If you want, you can implement a custom Controller from the ticket to enable selection of all records on the currently active page only when DataAccessMode = Server (we did not follow this route in the XAF code, because it would be more confusing and even damaging for users who got used to this command). Alternatively, you can set DataAccessMode = Client/DataView  for a required ListView node using the Model Editor (of course, it you do not have many data records).


If these solutions do not help, please describe your real life use-case scenario where this SelectAll feature is needed when grid is operating in server mode. It is possible that we have an alternative and even better technical solution for you, e.g. like we did for Reinhold and his reporting scenario.



Thursday, February 2, 2017

New and updated help topics in version 16.2.4

Recently, Dennis has published a huge list of changes introduced in XAF documentation in the previous major update (16.2). In this post, I would like to overview another set of changes in XAF documentation introduced with the 16.2.4 minor update of XAF.


Monday, May 2, 2016

Experimental support of DataView mode in Analysis editors of the PivotChart module in v15.2.10 - YOUR FEEDBACK IS NEEDED


Starting with v15.2.10 the DevExpress.ExpressApp.PivotChart.PivotChartModuleBase and 
DevExpress.ExpressApp.PivotChart.AnalysisEditorBase classes provide the new
 DataAccessMode property. The supported values are  Client (default) and DataView (new).Use the first class via the Application Designer to configure the required data access mode globally for all analysis editors in the application while the second class can be used in a ViewController to configure individual editors (learn more...).
Refer to the eXpressApp Framework > Concepts > UI Construction > Views > List View Data Access Mode  documentation to learn more on the specificities of each data access mode, because the validity of the PivotGridSettingsContent property is up to the XAF developer. For instance, in DataView mode non-persistent properties are not processed.


To test the preview version of this functionality right away in v15.2, almost one month prior to the official release, do the following:

Monday, April 11, 2016

Experimental support of DataView mode in Pivot Grid List Editors in v15.2.9 - YOUR FEEDBACK IS NEEDED

There is other performance related news today. This time it is for users who need to analyze and visualize large amounts of data using the pivot table. 


Starting with v15.2.9, we have made improvements to our Pivot Grid List Editors and are ready to share a preview of our work. So far, things are pretty stable, and we have not found any issues in scenarios with DataView (a few XAF customers tested this functionality earlier did not experience problems either). We still wanted to collect more feedback and hear from you about how this works in your real projects. The more scenarios we cover at this stage, the better for the product. If all goes according to plan, this functionality will be officially released in the upcoming 16.1 build, which should be out around early June.

3 simple steps to improve the overall performance in a middle-tier application server scenario

UPDATED
The contents of this article were merged into the new document at 
Security - How to reduce the number of permission requests and improve overall performance.
=============

Preamble

Here I will be talking about the configuration described in the eXpressApp Framework > Concepts > Security System > New Security System > Middle Tier Security - WCF Service article, assuming that the application server (YourSolutionName.ApplicationServer) is used with a desktop client app (YourSolutionName.Win). I am not talking about the web client, because I anticipate that in this configuration the Client-Side Security (2-Tier Architecture) with the integrated mode (SecuredObjectSpaceProvider) is a more typical choice as long as the database is located on the same web server where the ASP.NET app is deployed.




1. Server or DataView data access mode for ListView

While this is not specific to the 'application server' scenario, it is still worth mentioning these options explicitly when you need to work with large lists in grids in an XAF app. You can learn more on how to select an appropriate mode for your particular case from the online XAF documentation: eXpressApp Framework > Concepts > UI Construction > Views > List View Data Access Modes.

Disabling/enabling the Linked Nodes feature in the Model Editor (UPDATE for v15.2.9)

A while ago we conducted a survey on this feature and I want to share what we have done since then. Based on the user comments we received from the blog and other sources we decided to disable this feature by default, because it affected the Model Editor performance while being rarely used. Since there were also users who used from time to time, we also provided the capability to enable it via the button in the toolbar (available at both design and run time).




We hope that this behavior will meet the needs of the majority of our users and look forward to hearing from you in comments.

Tuesday, March 15, 2016

Speeding the Model Editor up for large data models by disabling the Linked Nodes feature - YOUR FEEDBACK IS NEEDED!

We have recently received an inquiry from a customer who experienced low performance and intensive CPU utilization when opening the Model Editor for quite a complex project...Here I wanted to share a simple tip (+ short survey in the end!) that has helped that guy to improve the situation a lot in his particular project. To refresh your memory about 'Linked Nodes' (or Links as you see it in the Model Editor), let me quote our online documentation:

Certain nodes have a "virtual" child node named Links. Under this node, you can see nodes that contain references to the current node. The screenshot below illustrates the Department node of the IModelClass type. Within the Links node, you can see the Creatable Item for the Department object, Members of the Department type and Views designed for the Department type.



Our performance tuning tip is to disable this feature if you do not really use it or if it causes performance problems when the data model is really complex. Thus a lot of calculations are required to detect all dependencies aka linked nodes.

To apply this tip, set the static DevExpress.ExpressApp.Win.Core.ModelEditor.ExtendModelInterfaceAdapter.LinksEnabled property in the constructor of your WinForms ModuleBase descendant in the YourSolutionName.Module.Win/Module.xx file:

Tuesday, December 22, 2015

MediaDataObject - Declaring images as object references instead of byte array

In v15.2 we have introduced the new MediaDataObject business class. The use of this type mainly reduces traffic in Web apps because images are cached in the browser cache (compared to images declared as byte[]).  

We have invented this solution when optimizing the new Web style performance on mobile devices. 
For instance, in our XCRM demo application (installed to C:\Users\Public\Documents\DevExpress Demos 15.2\Components\eXpressApp Framework\XCRM\, by default) the avatar picture in the top right corner is implemented using MediaDataObject:



Both WinForms and ASP.NET Image Property Editors are used automatically for properties of the MediaDataObject type, the delayed loading is also always enabled - no special attributes are required for this. However, you still can apply the ImageEditorAttribute to customize the editor's options. 

XPO and EntityFramework versions of this type are available in the Business Class LibraryRefer to the eXpressApp Framework > Concepts > Business Model Design > Data Types Supported by built-in Editors > BLOB Image Properties article to see example property declarations for your favorite ORM.

Friday, October 9, 2015

Improving performance when a large portion of data matches a workflow activity criterion

Here is a real customer scenario from a related Support Center thread

"Hi, I have an application with several workflows that work ok in my local computer (testing with few records), but when I deploy the workflows to a server and the workflow gets approximately 1,500,000 records that match the criteria the workflow service crashes...
I've done some testing and this only happens when the workflow needs to deal with a lot of data, workflows that deal with less records don't have a problem. I've been looking for an alternative like XPCursor or something similar to ask the workflow to page the records that meet the criteria but I haven't found any."


After some time, we could replicate this behavior locally and found that it could be easily improved upon on our side. In short, our solution is in using XafDataView + a sort of paging  when first querying and processing records that match a certain workflow activity definition criteria in the workflow service. 

Tuesday, March 3, 2015

Simplifying declaration of calculated properties in code for DataView mode with Entity Framework

Starting with v14.2.4 (and even 14.1.9) you can use the DevExpress.ExpressApp.DC.CalculatedAttribute to specify an expression used to calculate a property value of an Entity Framework class in Data View mode:
[C#]
public class Payment { public Int32 ID { get; protected set; } public Decimal Rate { get; set; } public Decimal Hours { { get; set; } [NotMapped, DevExpress.ExpressApp.DC.Calculated("Rate * Hours")] public Decimal CalculatedAmount { get { return Rate * Hours; } }
   // Other data properties and logic...
}
This attribute functions exactly like the DevExpress.Xpo.PersistentAlias attribute applied to a regular business class property. Of course, properties, referenced in the specified expression (using our cross-platform object-oriented criteria language) should be persistent to be able to run an SQL query at the database level. 

To remind you of the DataView mode, this is what you will see in the SQL Server Profiler if you set DataAccessMode = DataView for the Payment_ListView node containing only the Amount column above:

SQL:
SELECT 
    [Limit1].[ID] AS [ID], 
    [Limit1].[C1] AS [C1]
    FROM ( SELECT TOP (2147483647) 
        [Extent1].[ID] AS [ID], 
        [Extent1].[Rate] * [Extent1].[Hours] AS [C1]
        FROM [dbo].[Payments] AS [Extent1]
    )  AS [Limit1]

Note that even though our entity may contain a way more other persistent properties, the query included only the two from the expression above, which increases performance in certain scenarios.
The advantage of this attribute solution is that it is easier to keep your data model logic in one place/class instead of spreading it across multiple layers, e.g., Application Model, where the DataView settings are specified:

XAFML:
<ListView Id="Payment_ListView" DataAccessMode="DataView">
    <Columns>
       <ColumnInfo PropertyName="CalculatedAmount" IsNewNode="True" />
    </Columns>
</ListView>




If you are not sure of which ListView data access mode is best for your particular screen, these guidelines in our docs will help you decide.

Friday, October 10, 2014

How to improve the application's performance

"Long time no see"...but I think that today's post will be added into favorites by many of you so it is worth a delay. We've collected typical mistakes in ORM data model design as well as general issues that may lead to performance problems and provided solutions and general recommendations in one place/KB article for you:


This collection covers the most popular scenarios and is based on what we have suggested in the Support Center database. If you have suggestions or questions, feel free to comment - we will be happy to make this troubleshooting guide yet more helpful.

BTW, a bit off-topic, but I have fixed a couple of small memory leaks in v.14.1.7 (related to delayed initialization of tabs and security), so you may want to install this hot fix build (or wait for v14.1.8+) to have more stability and less memory usage in XAF Web UI.

Happy speeding!;-)


Tuesday, February 18, 2014

AuditTrail module performance improvement in v13.1.10 and v13.2.7

I would like to draw your attention to an improvement we recently made in the AuditTrail module:

AuditTrail - Low performance when saving data under certain circumstances

Please install the version 13.1.10+ or 13.2.7+ and let us know whether it now works better in your app.

I am focusing on this due to a recent discussion in this support ticket. In short, if something is not performing well or fast enough, it is always worth researching the cause of this behavior, rather than disabling a feature completely, especially when it relates to built-in XAF modules.

There may be some tricky or uncovered scenarios, and specialized profiling tools (e.g., AQTime and SQL Server Profiler) may help to find the cause of such performance issues. If you are not so familiar with using profilers (imho, it is still important to master them for the future for any professional developer, though) to profile the project yourself, feel free to send it to us, so that we can research it and find the best solution. I understand that preparing an entire project or test sample may take some time, but the result is worth it. This may also help improve the product itself, and the experiences that other users may be facing, which is always appreciated by the community. Thanks!