dotnet / dotnet/maui

Poor CV performance, ghosting, crashing on Windows

Open
#31,411 4 comments 2 reactions 0 assignees View on GitHub
area-controls-collectionview platform/windows s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Current Behavior

When using a CollectionView on Windows with a complex datatemplate (the issue is more exaggerated the more complex data template), you will observe ghosting while scrolling and low performance. Scrolling will "stutter" and mutating the datatemplate (setting a visibility property from true to false) in bulk can sometimes cause a `COMException` and a crash (no stack trace, `COMException` is empty even with Just My Code disabled and mixed debugging on).

The below video is captured running in **release** mode.

https://github.com/user-attachments/assets/f5dd0227-03b8-4699-9af9-add1581bbd35

### Expected Behavior

High performance scrolling with no "jittering", no crashing when children dynamically updated, just generally more stable.

### Steps To Reproduce

1. Create a collectionview binded to ~2000 items
2. Create a complex datatemplate. The more complex the datatemplate, the better.
3. Scroll to observe poor performance, jittering, ghosting.
4. Mutate the children in bulk (for example, bind to a `Visible` property and set half of them to `False`
5. Observe crash (sometimes)

### Link to public reproduction project repository

https://github.com/daltzctr/PoorCVRepro

### Environment

```markdown
- .NET MAUI CommunityToolkit: None
- OS: Windows 11 26100.4946
- .NET MAUI: .NET 10 Preview 7
```

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by running the linked PoorCVRepro project on Windows and reproduce the CollectionView scrolling issues with about 2,000 items and a complex data template. Then test bulk visibility changes in the same reproduction; done means scrolling is stable without ghosting or jittering and bulk child updates no longer sometimes crash with an empty COMException.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.