question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: how to trace slow UI in a XAML app (e.g. Windows Terminal)

See original GitHub issue

I have slow reaction (up to 5 seconds) reaction of New Tab buttons in Windows Terminal (context menu takes a few seconds to appear; new tab button freezes for a few seconds before even a new tab is created). I reported the issue in WT repo: https://github.com/microsoft/terminal/issues/6409

I asked how to enable tracing of WT UI handling. I was directed by @zadjii-msft to ask this question in this repo, and @zadjii-msft strongly suggested that the slowness comes not from WT code but from XAML framework itself.

Are there generic ways to trace what is happening? (e.g. what events are emitted and how long do their handling takes). I have zero context about how WT uses XAML or what it does on handling the button clicks. Unfortunately, I don’t have experience with using perf.exe or Event Tracing, but I’ll be happy to try any instructions you suggest.

My system has about 80% of used physical memory and HDD (it’s a L470 lenovo laptop).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:21 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
zadjii-msftcommented, Jul 29, 2020

IMO It would probably just get punted back to the experts over here, or to Kenny over in microsoft/xlang / microsoft/cppwinrt, but I doubt the language itself is at fault here - I’d imagine that those libraries are getting regardless if XAML is being used via c++/winrt, c#, rust, cxx, or whatever other language the xlang team adds WinRT support to next.

1reaction
zadjii-msftcommented, Jul 15, 2020

For the record, the Terminal team is plenty accustomed to using those tools, we’ve just focused our efforts primarily on CPU performance, because the memory impact of the actual terminal bits of the Terminal is pretty minimal. We’ve kicked this thread over to the WinUI repo because the people who are best equipped to analyze the memory impact of WinUI are the people who own WinUI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WPF: App runs much slower in Visual Studio Debug Mode ...
I'd start the console app from visual studio first, create new instances by starting directly from the file system.
Read more >
Optimize your XAML markup - UWP applications
At app startup, limit the XAML markup that is loaded to only what you need for your initial UI. Examine the markup in...
Read more >
Analyze resource consumption and UI thread activity (XAML)
This tool helps improve the XAML application performance by showing a detailed view of the applications' resource consumption.
Read more >
Performance Improvements in .NET MAUI
Want to know why .NET MAUI apps boot faster, run smoother, and are smaller? This post break down how we made .NET MAUI...
Read more >
What might cause a WPF application to be noticeably ...
I have a scenario that I can't explain. I've recently been working on some performance improvements to a moderately complex WPF application ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found