dotnet / dotnet/wpf

Very low Text Rendering Performance due native C++ interop

Open
#4,768 10 comments 6 reactions 0 assignees View on GitHub
Investigate Performance
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: 5.0.6
* Windows version: 21H1 (Build 19043.928)
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
* Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)?: No



**Problem description:**
UIElement.Measure this very slow

**Actual behavior:**
![image](https://user-images.githubusercontent.com/10373452/123769736-e2cc5480-d8c9-11eb-9368-5540156292f4.png)

**Expected behavior:**
Fast measuring for WPF rendering.
If there is nothing more that can be optimized in the measure method, it might make sense to cache the measures according to certain parameters, since this is very slow with large visual trees.
Compared to Windows Forms, Windows Forms is superior in terms of performance here.

Would it not make sense to write the measure method in native C++ somehow to optimize the performance accordingly or is the overhead here too large?

**Minimal repro:**
```xaml









Test
Test
Test
Test
Test
Test

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.