Dear #msdyn365bc Twitter friends.

It is Saturday, and therefore also time for another #performance thread. This Saturday, we focus on...

How to work with a performance problem

Source is always aka. ms/bcperformance (remove the space)

/1
Before getting started on solving any #performance problem, it often helps to define and quantify "slow" and also negotiate acceptable values for execution time of "slow" operations with users.

/2
To define baselines for performance, and to test whether new code/extensions introduce a performance regression, you can use the Performance Toolkit extension. The extension makes it easier to simulate and compare user experiences to your baseline.

#msdyn365bc #performance

/3
Use the Performance Toolkit when you want to
* test that new code doesn't introduce regressions
* test your code with a lot of users running the same process
* roll out a new process/install a new extension

Learn more here: docs.microsoft.com/en-us/dynamics…

#msdyn365bc #performance

/4
To solve a performance problem, a common pattern is to iterate over these steps:
* Measure system performance and collect data
* Locate a bottleneck
* Eliminate the bottleneck

Continue until the "slow" operations are close to acceptable value.

#msdyn365bc #performance

/5
You can use telemetry to analyze common scenarios
* a page/action/report is slow
* login is slow
* everything is slow between 2 and 4 pm
* everything was slow last Friday
* everything is slow

See a list here (or read on)
docs.microsoft.com/en-us/dynamics…

#msdyn365bc #performance

/6
Symptom: Some pages are slow
Analyze: RT0004
Why: Each page background task will open a new session. Any expensive action in the OnCompanyOpen trigger will slow down opening new sessions.

#msdyn365bc #performance

/7
Symptom: Login is slow
Analyze: RT0004
Why: Any expensive action in the OnCompanyOpen trigger will slow down opening new sessions.

#msdyn365bc #performance

/8
Symptom: Everything was slow during this period of time
Analyze: LC0004
Why: Check whether a copy-company operation was running while the performance issue occurred.

#msdyn365bc #performance

/9
Symptom: Everything was slow during this period of time
Analyze: RT0012
Why: Maybe the performance issue was because of locking in the database.

#msdyn365bc #performance

/10
Sidenote: in 2022 release wave 1, you will also be able to take snapshots of database wait statistics. This will help you determine if you have a locking problem or different database problem (or no database problem).

#msdyn365bc #performance

/11
Symptom: Page xyz is slow. It wasn't like that last week.
Analyze: LC0010
Why: Maybe an extension was installed that interferes with the page in question.

#msdyn365bc #performance

/12
Symptom: Some pages or reports are slow to load.
Analyze: RT0005
Why: Investigate whether the data operations on the page or report are taking a long time to complete.

#msdyn365bc #performance

/13
Symptom: A report is slow
Analyze: RT0006
Why: Check whether the report is reading more data than you expected. Also check if the report can run with data access intent ReadOnly.

#msdyn365bc #performance

/14
Symptom: UI feels slow in general
Analyze: RT0008
Why: Calling your environment too aggressively with web service requests can affect the overall performance of the system.

#msdyn365bc #performance

/15
Use Additional logging from Help&Support page to capture all SQL queries for 15 min for a session. This lets you analyze queries that take a short time to run but happen very frequently.

Read more here: docs.microsoft.com/en-us/dynamics…

#msdyn365bc #performance

/16
With Business Central on-premises, you can change the default threshold that defines long running queries to analyze queries that take a short time to run but happen very frequently.

Read more here: docs.microsoft.com/en-us/dynamics…

#msdyn365bc #performance

/17
If a specific page takes long to load, it might be due to extensions adding expensive operations to the page triggers. You can use the page inspector to analyze this by navigating to the Extensions tab.

Read more here:
docs.microsoft.com/en-us/dynamics…

#msdyn365bc #performance

/18
Use the AL Profiler to capture performance profiles of code executed in a snapshot. Then analyze the time spent in the performance profiling editor view in VSCode using top-down/bottom-up call stack views.

Read more here: docs.microsoft.com/en-us/dynamics…

#msdyn365bc #performance

/19
Which tools are good when?

There are pros and cons for the different tools described in this thread. The performance tuning guide have a table that summarizes this.

Read more here: docs.microsoft.com/en-us/dynamics…

#msdyn365bc #performance

/20
That is rounding up todays #msdyn365bc #performance Twitter masterclass (and also the last one in 2021).

As always, the performance tuning guide
aka. ms/bcperformance (remove the space)
is the source of truth.

Let me know how we can improve or do a PR on docs yourself.

/21

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Kennie Nybo Pontoppidan

Kennie Nybo Pontoppidan Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(