Open chabiss opened 1 month ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Loaded Assembly xxxxx
phase takes too long. (#14822), similarity score: 0.78Note: You can give me feedback by thumbs upping or thumbs downing this comment.
I can repro this issue at Android platform on the latest 17.11.0 Preview 6.0( 8.0.71). And it works well on .NE7, that's almost a quarter of the time it takes net8.
@chabiss if you close XAML Live Preview
, does it improve?
I will profile this, but since there are many lines of:
[riodictablemaui] Explicit concurrent copying GC freed 619(41KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 4579KB/9158KB, paused 1.263ms,173us total 13.825ms
That's not exactly normal.
I suspect I'm going to find some heavy byte[]
/ string
/ or Image? passing around. I should be able to see the stack trace of who is doing it in dotnet-trace
.
Ok, I don't think the slowness related to XAML Live Preview, but I'm still profiling.
@chabiss one change to make it a bit better:
Before it was firing INotifyCollectionChanged
events for each element in the period table. We can populate the list and refresh once instead.
@chabiss there is unfortunately, not an allocation tracker for dotnet-trace
, so I've resorted to just taking dotnet-gcdump
snapshots and looking at a point in time.
I think there are two large contributors to allocations in Debug mode:
Microsoft.Maui.SourceInfo
:
It seems like there are many duplicate System.Uri
objects, because nearly all of these instances are from the same XAML file.
It looks like we'd always create these if a debugger is attached:
I'm wondering if we can reuse the System.Uri
per file and not allocate so many.
Microsoft.Maui.Controls.SetterSpecificityList
:We knew that the "setter specificity" PR in .NET 8 would hurt performance. We have a change in .NET 9 that allocates 50% less:
I'm still confused what is special about your app that makes these worse, still investigating.
Here is what I found that could be improved for the runtime, comparing Debug vs Release:
Description
Development on Android is very slow. The time it takes to launch my app is almost a 1 min on Debug while the release version is way much faster. This used to launch much faster in .NET 7
https://github.com/user-attachments/assets/b74323e9-f916-4317-aeff-1458530693ad
Steps to Reproduce
https://github.com/user-attachments/assets/e8ee00e5-ddfd-482c-9bd1-35b2f7493b3f
Link to public reproduction project repository
https://github.com/chabiss/periodictable
Version with bug
8.0.71 SR7.1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
7.0.49
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
You have better performance on 'release' build, but then you loose XAML Hot Reload
Relevant log output