Update performance documentation with latest recommendations#3113
Update performance documentation with latest recommendations#3113
Conversation
|
Learn Build status updates of commit 93cabf9: ✅ Validation status: passedFor more details, please refer to the build report. |
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit 4c55a5a: ✅ Validation status: passed
For more details, please refer to the build report. |
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit 7d7cec3: ✅ Validation status: passed
For more details, please refer to the build report. |
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit 7d7cec3: ✅ Validation status: passed
For more details, please refer to the build report. |
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit e885c13: ✅ Validation status: passed
For more details, please refer to the build report. |
There was a problem hiding this comment.
Pull request overview
This PR updates the performance documentation with current best practices for .NET MAUI development. It addresses issue #3105 by modernizing guidance around list controls, Shell navigation, async programming, and dependency injection patterns.
Changes:
- Replaces ListView performance guidance with CollectionView recommendations
- Clarifies Shell's role in improving startup time rather than general performance
- Adds async/await best practices, including fire-and-forget anti-patterns and CollectionView threading behavior
- Documents IDisposable pitfalls with transient service registration in dependency injection
| For more information about migrating from <xref:Microsoft.Maui.Controls.ListView> to <xref:Microsoft.Maui.Controls.CollectionView>, see [CollectionView](~/user-interface/controls/collectionview/index.md#move-from-listview-to-collectionview). | ||
|
|
||
| > [!WARNING] | ||
| > Don't place a <xref:Microsoft.Maui.Controls.CollectionView> or <xref:Microsoft.Maui.Controls.ListView> inside a <xref:Microsoft.Maui.Controls.ScrollView> or a <xref:Microsoft.Maui.Controls.StackLayout>. This prevents the virtualization from working, which results in degraded performance and increased memory usage because all items are rendered at once. Instead, use the built-in header and footer capabilities of these controls if you need additional content above or below the list. |
There was a problem hiding this comment.
The StackLayout mentioned in this warning is ambiguous. .NET MAUI has both StackLayout and VerticalStackLayout/HorizontalStackLayout. Consider clarifying which layout types are affected, or use the more general term "stack layouts" to cover all variants.
Updates performance guidance per issue #3105: recommend CollectionView over ListView, clarify Shell expectations, add async best practices, and document IDisposable/DI pitfalls.
ListView → CollectionView
ScrollView/StackLayout(breaks virtualization)Shell apps clarification
Async programming
awaitasync methodsTask.Delayrecommendation (not a common perf concern)CollectionView data handling
CollectionViewthrowing on off-threadItemsSourceupdatesObservableCollection<T>guidance: preferList<T>for static data; batch updates and reassignItemsSourcefor large datasetsIDisposable and dependency injection
IDisposabletypes as transient services (container won't dispose them)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Internal previews