Program Runs VERY slowly and jittery in WPF
I have been working on a semi solar system project at school. I chose to make a solar system simulation. We HAVE to use WPF for this sadly. On school computers my program runs ok (still slow and jittery but its much more manageable) and on my home computer it runs extremely slowly. My home PC is much more powerful than the schools one. I have 32Gig of ram, 3070Ti, Ryzen 5 5600x etc but it is very slow.
6 Replies
This need a ton more details
Have you profiled your app?
What do the performance metrics say?
Maybe something can be optimized
What kind of simulation is this?
Hard to tell without seeing any code
You're doing something that is not performant
What is it? Anybody's guess
https://codeshare.io/depokR Here is the code
In the link i have made DispatchTimer slow at 100ms it is usually around 30 to 40ms
Im not sure what that means
and by performance metrics do you mean this? The diagnostics on the right hand side?
Bear in mind that the slider and reset button dont currently work how they are supposed too. And for optimisation, i have thought about my PlanetaryForces and UpdatePos subroutines but the math seems quite simple. I have only picked up c# in the past weeks so sorry for not understanding alot of it
It's better if you draw it directly rather than relying on controls
Because with controls it needs to recalculate positions / layout when invalidated