C
C#17mo 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
phaseshift17mo ago
one, dont measure perf in debug mode.
br4kejet
br4kejetOP17mo ago
Yeah i know but I have a bunch of bugs in release mode
phaseshift
phaseshift17mo ago
'in release mode' means you 'have bugs'
br4kejet
br4kejetOP17mo ago
Yeah I'm using a few too many preprocessors that check for DEBUG...
phaseshift
phaseshift17mo ago
😬
br4kejet
br4kejetOP17mo 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
br4kejetOP17mo ago
This is all that the profiler is giving me
phaseshift
phaseshift17mo 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
br4kejetOP17mo ago
So it probably was just the app getting lucky and running on a somewhat free core?
phaseshift
phaseshift17mo ago
no, the scheduler is plenty smart enough
br4kejet
br4kejetOP17mo ago
Damn i dunno what's causing the lag then I got release mode working and it's at like 4 fps
phaseshift
phaseshift17mo 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
br4kejetOP17mo ago
Can't get release profiler to work 😦
br4kejet
br4kejetOP17mo 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
br4kejetOP17mo ago
br4kejet
br4kejetOP17mo 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
Omnissiah
Omnissiah17mo ago
i doubt this 3353 is not a good size, should at be divisible by 4
br4kejet
br4kejetOP17mo ago
I resized my window and the bitmap just happened to get that width
Accord
Accord17mo 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