C
C#12mo ago
br4kejet

❔ App is sometimes slow after starting, but fast other times

(This is a WPF app) I don't really know how else to describe it other than sometimes when I start the app in debug mode, it's extremely slow, and it will be that way even if i start it multiple times. But sometimes I get lucky and when I start it, the app runs quite quickly and the UI resizes pretty fast. What could be causing this? Could it just be because sometimes my app gets an entire CPU processor to itself with barely anything running, whereas before it was sharing it with many threads?
19 Replies
phaseshift
phaseshift12mo ago
one, dont measure perf in debug mode.
br4kejet
br4kejet12mo ago
Yeah i know but I have a bunch of bugs in release mode
phaseshift
phaseshift12mo ago
'in release mode' means you 'have bugs'
br4kejet
br4kejet12mo ago
Yeah I'm using a few too many preprocessors that check for DEBUG...
phaseshift
phaseshift12mo ago
😬
br4kejet
br4kejet12mo ago
Even in debug mode though, I saw a massive FPS change when the app was running in "fast" and "slow" mode. It went from around 5fps to maybe 30fps~
br4kejet
br4kejet12mo ago
This is all that the profiler is giving me
phaseshift
phaseshift12mo ago
you can't reason about anything i) in debug mode, ii) with other intensive processes running at the same itm Also anti virus is a pita
br4kejet
br4kejet12mo ago
So it probably was just the app getting lucky and running on a somewhat free core?
phaseshift
phaseshift12mo ago
no, the scheduler is plenty smart enough
br4kejet
br4kejet12mo ago
Damn i dunno what's causing the lag then I got release mode working and it's at like 4 fps
phaseshift
phaseshift12mo ago
should be something pretty obviouos in a proper profile then, or anti virus doing something weird - youd see that in high cpu % in e.g. task manager
br4kejet
br4kejet12mo ago
Can't get release profiler to work 😦
br4kejet
br4kejet12mo ago
But even then it would just tell be it's a kernel thing causing the lag My app is using OpenGL so I guess it could be some random GPU overhead too
br4kejet
br4kejet12mo ago
br4kejet
br4kejet12mo ago
I assume that's using kernel level blocking to wait for the GPU to write all the pixels which would explain the 95% that visual studios was saying... rip No idea why it randomly reads really quickly and then other times takes almost 250ms Wait nevermind it appears it's the WriteableBitmap's Lock function causing a ton to lag too... Wtf... for some reason when the bitmap's size is exactly 3353x960, it performs well, but if I make it 1 pixel more or less, it starts performing horribly 3329x960 also has the same effect... really weird
boiled goose
boiled goose12mo ago
i doubt this 3353 is not a good size, should at be divisible by 4
br4kejet
br4kejet12mo ago
I resized my window and the bitmap just happened to get that width
Accord
Accord12mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
❔ getting all methods with an attribute in an optimized wayhey all, im trying to find a way to add all methods with an attribute to dictionary. i want to be ab❔ anyone interested in helping a starter?Im a starter looking to start learning c#. after spending days researching where to start im still k❔ How to mock HttpClient that is automatically applied in class without IHttpClientFactoryHello, I have a problem because I don't know how can I mock ``HttpClient`` in my tests for ``StripeC❔ Textmate themes for custom languages?So it's apparently possible to add support for custom syntax highlighting via textmate grammars acco❔ My Label Doesn't show up even though no errors.Hi, I am making like PC Stats app like HWInfo or something like that, but I am using Open Hardware M❔ NuGet broken, i have no ideaSo it has been ages since i coded in c#, turns out my NuGet is broken or something❔ C++ Program displaying same output regardless of input value.Attached is my code and the output I receive with inputs "5000", "20000", and "34567" The program is❔ Learning ArchitecturesHi! Can you recommend any books, articles, links to github that will help me better understand all k❔ (Due in about two days) Fish Project for C# UnityHiya! I'm new to C# and im currently in university for Game Development in two days I have this proj❔ Are strings the best way for Server-Client UDP communication?Hi I'm developing a server-client udp communication system using System.Net ( with classes like UdpC