dotnet / dotnet/wpf

TextMetrics+FullTextLine.Dispose() gets slower over time until a GC

Open
#10,199 1 comment 1 reaction 0 assignees View on GitHub
:mailbox_with_no_mail: waiting-author-feedback Needs minimal repro project
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

I have working on some optimizations to some of our controls to make scrolling faster and I noticed that while scrolling it initially was fast but the more I used it, the more laggy it became. When I profiled with dotTrace it showed that FullTextLine.Dispose() was taking more time. If I force a GC.Collect I get speed back and FullTextLine.Dispose is fast again. Unfortunately this calls into PresentationNative.LoDisposeLine which is not open source so I am unable to determine why it gets slower.
Is there a workaround or a method I can call (even via reflection) that would trigger whatever GC.Collect is triggering?

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.