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