C# app is laggy when launched without Visual Studio running

Viewed 56

I have a WPF app that has a lot of moving objects (propagates the satellite orbital motion and shows it on the map), using Path objects as orbits and moves icons along the path to show the satellite movtion along the track. When I build the app in Visual Studio, doesn’t matter debug or release version, it runs smoothly, all satellites move along nicely without any lag. But if I launch it from exe-file, it becomes very laggy, the motion becomes jumpy. When it's launched from VS or if VS is running in the background, GPU usage is more or less constant and stays at about 20%, and the graphics processor is being constantly used (see attached image). When VS is not running, GPU usage varies from 0% to about 50%, and the graphics processor is not used all the time.

GPU usage with and without VS running

I tried making the app use the GPU constantly from OS settings, but haven't seen any real changes. I tried turning the Visual Studio Hosting Process on and off, but the app was still laggy with it on and even worse with it off.

I think that VS is somehow helping the app run smoothly, but haven't figured how yet. Are there any compilation settings that can help?

0 Answers
Related