Snapshot Debugging vs AL Profiler in Business Central — When to Use Each
Compares snapshot debugging and the AL profiler in Business Central. Snapshot debugging (F7 to start, Alt F7 to finish) is used to find the cause of errors, and the speaker calls it very useful for production. The AL profiler is used to find performance bottlenecks through an ALCPU profile file whose function-call timings link to the code. The video walks through a profile file and shows Analyze Performance (the current user's session) and the Scheduled Profiler (another user's session).
- Introduction
- Snapshot Debugging Explained
- AL Profiling Introduction and Use Cases
- AL CPU Profile File and Navigation
- Performance Profiler Method
- Scheduled Profiler for Other Users
- Comparison and Use Case Summary
- Conclusion
Overview
The video compares two developer tools in Business Central. Snapshot debugging captures a session so a developer can set snap points and step through code execution to analyze errors. It is started with F7 and finished with Alt F7, and it needs a configuration entry in launch.json.
The AL profiler targets performance rather than errors. It records function call timings and produces an ALCPU profile file that links back to source code, which is opened in VS Code. The video shows two ways to capture a profile: the Performance Profiler for your own session, and the Scheduled Profiler for another user’s session within a set time window. It closes with a summary of when to use each tool.
Key points
- Snapshot debugging is started with F7 and finished with Alt F7. It needs a configuration entry in launch.json.
- If no session ID or user ID is configured, the snapshot is based on the first session that connects to the web client.
- The speaker calls snapshot debugging very useful for production environments, for finding why an error occurred.
- The AL profiler is not necessarily for errors. It is useful for bottlenecks and produces an ALCPU profile file with function call timings and links to the code.
- Profile files can be imported or downloaded and analyzed in VS Code.
- Analyze Performance (the Performance Profiler) is used when you are logged in and want to profile your own session.
- The Scheduled Profiler (Analyze Performance with Scheduled Profiler) captures another user’s session by username, start time and end time. The resulting profile can be downloaded and analyzed in VS Code.
Features
Every feature below: status not stated, demoed.
| Feature | At |
|---|---|
| Snapshot Debugging | 0:20 |
| AL Profiling | 2:19 |
| AL CPU Profile File Format | 3:03 |
| Performance Profiler | 4:51 |
| Scheduled Profiler | 5:56 |
AL objects mentioned
As heard in the captions. A name that matches one object page by exact type and name links to it; the others stay as named.
- page 22 “Customer List” at 3:56
- page “page extension” at 3:56
Not found in BC28-30: page “page extension”.
Quotes
- 1:24 “you initialize a snapshot debugging with a key F7. Um then um then if you don’t have a session ID or a user ID”
- 1:52 “then you execute the code uh that you want to debug and after you execute the code you uh close the snapshot uh or”
- 3:03 “You generate the profile file. Uh the profile file is a file that has the extension ALCPU profile.”
- 5:45 “if you want to capture another user session uh you go to somewhere very close to where we’ve been.”
- 6:26 “So snapshot debugging very useful for production environments. start um a snapshot um you run your process”
Disclaimers in the video
- 2:46 other: this is the last uh portion here and it’s quite new compared to the previous uh snapshot debugging method
