Daltz333
✅ Optimizing `HTTPClient.GetAsync()` and large strings
I am writing a client application that consumes a web API at a near real-time rate (100ms). I am using
httpClient.GetAsync()
to retrieve the content and then I grab the string contents with Content.ReadAsStringAsync()
.
Then, I deserialize it with JsonConvert.DeserializeObject<T>()
to a format I expect (in some cases (out of my control), it's impossible to directly deserialize, in which case I deserialize to dynamic
to parse manually).
Because this is done every 100ms, it's creating a large number of GC (short, but frequent) creating some pretty bad GC pressure. This is on the count of ~10 ~5ms GCs/s. Unfortunately, this can dramatically slow down execution, especially since GCs block all threads, including GUI.
I assume there are strategies to mitigate and solve this, this has to be a solved problem. Unfortunately, I'm not finding reliable/updated answers in google (the most common answer is... don't use C#).72 replies
❔ Unable to profile WinUI3 application
I'm unable to launch the performance profiler for a WinUI3 packaged application. To begin, the steps I take are.
1. Debug -> Performance Profiler
2. Set to Release
3. Only click CPU Usage (any options or any combination also fail)
4. Start
The application launch but the profiler fails to launch with the following exception.
I'll happily provide any additional information (except the project, unfortunately).
4 replies
❔ [MAUI] Global Activity Indicator
I have a MAUI Shell application where I'd like to show a global ActivityIndicator or loading icon. Unfortunately, I don't see a way to place an ActivityIndicator on the
Shell
XAML or class directly, and doing a hack with a popup page is extremely unreliable. Is there a way I can add views directly to the Shell
or MainPage
(which is of type Shell
) directly?2 replies
✅ MVVM Source Generator not copying attributes
It seems that if you do
It doesn't generate the
[JsonIgnore]
attribute on MyBadProperty
, thus causing any serialization to fail since ImageSource
throws an exception on attempted serialization. Any ideas of a workaround without just not using source generators?3 replies