Skip to content

Commit ae41c94

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 2fd5846 + 757669b commit ae41c94

File tree

8 files changed

+1048
-5
lines changed

8 files changed

+1048
-5
lines changed

accelerate-sidebar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const sidebars = {
3232
'tools/dev-tools/tools/events',
3333
'tools/dev-tools/tools/breakpoints',
3434
'tools/dev-tools/tools/metrics',
35+
'tools/dev-tools/tools/profiler',
3536
]
3637
},
3738
'tools/dev-tools/mcp',

accelerate/installation.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@ Include your Avalonia UI license key in the executable project file (`.csproj`):
3030
</ItemGroup>
3131
```
3232

33-
> For multi-project solutions, you can store your license key in an [environment variable](https://learn.microsoft.com/en-us/visualstudio/msbuild/how-to-use-environment-variables-in-a-build) or a [shared props file](https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?view=vs-2022#directorybuildprops-example) to avoid duplication.
33+
For multi-project solutions, you can store your license key in an [environment variable](https://learn.microsoft.com/en-us/visualstudio/msbuild/how-to-use-environment-variables-in-a-build) or a [shared props file](https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?view=vs-2022#directorybuildprops-example) to avoid duplication.
34+
35+
:::warning
36+
Do not leave the license key value blank. If left blank, you may be unable to build or open your project.
37+
:::

accelerate/tools/dev-tools/advanced/options-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ But it is possible to redefine this behavior by changing `DeveloperToolsOptions.
2929
```csharp
3030
this.AttachDeveloperTools(o =>
3131
{
32-
o.Runner = DeveloperToolsOptions.DotNetTool;
32+
o.Runner = DeveloperToolsRunner.DotNetTool;
3333
});
3434
```
3535

3636
Possible options are:
3737

38-
1. `DeveloperToolsOptions.DotNetTool` - global .NET tool.
38+
1. `DeveloperToolsRunner.DotNetTool` - global .NET tool.
3939
2. `DeveloperToolsOptions.AppleBundle` - runs macOS bundle by its ID. To make it work, you need to run `Developer Tools` process directly at least once.
4040
3. `DeveloperToolsOptions.NoOp` - do nothing. This option assumes the `Developer Tools` application was started by the user manually.
4141
4. `DeveloperToolsRunner.CreateFromExecutable(string)` - run executable by full path. This option is not recommended, unless you prefer a custom installation of the tool.
Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,51 @@
11
# Application Profiler Tool
22

3-
Experimental tool.
4-
Documentation is pending.
3+
While [metrics](./metrics.md) primarily contain a single dimension of information, suitable for displaying as a chart, profilers capture richer data. After a recording is completed, `Developer Tools` aggregates the results and displays them as a table.
4+
5+
## Recording a Profile
6+
7+
1. Click the **Record** button to start a profiling session.
8+
2. The application continues running normally while data is collected in the background.
9+
3. Click **Record** again to stop.
10+
4. Results are aggregated and displayed across separate tabs, one for each profiler type.
11+
12+
For best results, try to isolate the interaction you want to measure. For example, open a specific view or trigger a UI action while recording, so the data isn't diluted by unrelated activity.
13+
14+
## Style Matching
15+
16+
When a control is created or added to the visual tree, Avalonia evaluates all active style selectors to determine which ones apply. The Style Matching profiler aggregates match attempts.
17+
18+
Columns:
19+
- **Selector** — the style selector being evaluated (e.g., `TextBlock.h1`, `Button:pointerover > ContentPresenter`)
20+
- **Elapsed** — total time spent evaluating this selector across all match attempts
21+
- **Fast Reject Count** — how many times the selector was quickly ruled out without full evaluation. A fast reject occurs when a control can be excluded by a simple static check, such as a mismatched type or control name. Importantly, a fast-rejected control will not be re-evaluated later when activators change — for example, a `TextBox` will never be re-evaluated for `Button:pointerover`, because it was already rejected on type
22+
- **Match Attempts** — total number of times this selector was tested against a control
23+
- **Matches** — how many attempts resulted in a successful match
24+
25+
A high number of match attempts with very few matches can indicate an overly broad selector. Consider targeting a concrete control type rather than a base class to reduce unnecessary matching during control creation.
26+
27+
## Style Activators
28+
29+
Unlike Style Matching (which measures initial selector resolution), this profiler measures how often selectors are re-evaluated at runtime. This happens when conditional selectors — those with activators like `:pointerover`, `:focus`, `:pressed` — toggle on and off as the user interacts with the application.
30+
31+
Columns:
32+
- **Selector** — the style selector being re-evaluated
33+
- **Elapsed** — total time spent on re-evaluations
34+
- **Evaluations** — total number of times the selector's activator was re-evaluated
35+
- **Active Evaluations** — how many evaluations resulted in the style becoming active
36+
- **Activator** — type of activator responsible (e.g., pseudo-class, property match)
37+
38+
If a selector shows a very high number of evaluations, it may be toggling more often than expected. Narrowing the scope of such selectors can help.
39+
40+
## Resource Lookup
41+
42+
Every time a control, style, or binding resolves a resource by key (e.g., a brush, thickness, or template), Avalonia walks the resource hierarchy until it finds a match. This profiler aggregates those lookups by key.
43+
44+
Columns:
45+
- **Key** — the resource key being looked up
46+
- **Elapsed** — total time spent resolving this key across all lookups
47+
- **Total Lookups** — how many times this key was requested
48+
- **Successful** — how many lookups found a matching resource
49+
- **Theme Variant** — the theme variant (Light/Dark) active during the lookup
50+
51+
A key with many total lookups but few successful ones likely indicates a missing or misspelled resource definition. You can use the [Resources Tool](./resources.md) to inspect available resources at each scope.

0 commit comments

Comments
 (0)