Test of architecture
In this test I’m testing how fast the custTable form is opened on Tier1, Tier-2 and on a PROD environment. The PROD/Tier-2 environments are on service fabrics(self-service), and the databases seams to be elastic pool based. As seen on the table below the fastest execution happens on Tier-1, that is a one-box SQL, and the Tier-2 and PROD| Customer form | Warm execution | Cold execution |
| Tier-1 (DS12 V2) | 1.50, 1.49, 1.49 | 22.99 |
| Tier-2 | 2.20, 2.32, 2.20 | 16.96 |
| Prod (6 AOS’s) | 3.22, 3.25, 3.10 (20:00 CET) 2.37, 2.46, 2.40 (22:00 CET) | Not measured |
| Customer reason code form | Warm execution | Cold execution |
| Tier-1 (DS12 V2) | 0.11, 0.11, 0.12 | 1.01 |
| Tier-2 | 0.26, 0.27, 0.26 | 0.98 |
| Prod (6 AOS’s) | 0.27, 0.28, 0.23 | Not measured |
The complexity of the CustTable
As seen below, the CustTable contains 12 datasources, and quite many of them are joins. There are also 4 extension to the form.
We also see in the code in the CustTable is heavily regulated by code that controls features, country specific/regulatory elements, and display items. If we open the Customer form on a Tier-2 environment with 5 customers takes between 2-3s. In total there are 16.413 method calls, and of them 1.330 are unique method calls.
I did not get any meaningful information out of the recorded summarized tracefile analysis, so I must continue to more manually look into the actual execution of code.
Test of effect when reducing complexity CustTable
My next step in the analysis is to see what is affecting the execution time. In the following section I’m testing in a Tier-1 D12V2 environment. I have made 5 copies of the CustTable form, in each form, I’m removing more and more code and data sources. I name them:- Standard, but no calls to feature enablement
- Fast : All code and data datasources removed, except custTable and DirParty
- Faster : All code and data datasources removed, except custTable. Display method on customer name
- Fastest; All code is removed except CustTable data source
To simulate a “cold execution” we can flush the cache by adding the following to the URL: &mi=ACTION%3ASysFlushAOD
| CustTable form type | Warm execution (s) | Cold execution (s) |
| Standard 10.0.18 | 1.50, 1.49, 1.49 | 22.99 |
| 1.Standard, but no calls to feature enablement code | 1.34, 1.43, 1,39 | 17.94 |
| 2.Fast : All code and data datasources removed, except custTable and DirParty | 0.72, 0.72, 0.73 | 1.22 |
| 3.Faster : All code and data datasources removed, except custTable. Display method on customer name | 0.56, 0.62, 0.57 | 0.96 |
| 4.Fastest; All is removed except CustTable data source | 0.34, 0.34, 0.38 | 0.49 |
| 5.Customer reasoncode form | 0.11, 0.11, 0.12 | 0.32 |
WOW! – Other findings.
I have found one area that is affecting heavily the cold startup of forms. That is the office button, that is typically initiated when the form is loading. I tried disabling the office button code, a cold startup of CustTable went from 23s to 5s. And this button is used everywhere. This “fix” does not seam to have a large effect on warmed up system. But keep in mind that with the one-version strategy and adding extensions we are clearing any cache quite often, that the end-users needs to rebuild on each AOS. As there are thousands of forms, you can multiply the warmup with the number of AOS’s, and you realize why manual warmup take days. I have informed Microsoft, and hope for a positive response. Let’s continue to dig for code changes that can make the best ERP system even better, and share what you find.
I realized, that when debugging line-by-line, a small gray text pop’s up showing the actual elapsed execution time per statement. This allowed me to find the lines that actually are using a lot of time, by jumping from line to line. The timing here, is from when I did a debug of a cold system. On a warm system it will not show, as then it all is cached.
I’m really proud of finding this, as it have been on my bucket list to find some real good improvements. For more details on the chase for more performance, take a look at the Microsoft Yammer group (If you have access?) https://www.yammer.com/dynamicsaxfeedbackprograms/threads/1105410564505600