-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spinning square demo stutters on Windows 10 #234
Comments
Did you run in release mode? Debug mode in Rust can be slow. |
Unfortunately it happens on release builds too. I also checked and nothing else (of significance) was running on my machine at the time. Some more information: Same thing happens on the following machine (although it happens every 6 or so frames): Lastly, it does not appear to happen on Ubuntu on a somewhat aging laptop of mine so I assume that this is a Windows only issue. Setting the process priority to High or even Realtime makes no difference in Windows so this may not be related to process context switching. |
Perhaps you could detect this spike by logging idle time:
The idle event is emitted before going to sleep, so if the game loop works harder at irregular intervals, it might have less time to idle. |
This might be caused by varying update vs rendering. Using extrapolated time at rendering might fix the problem. |
Hi bvssvni, Thank you for your comments. I have tried quite a few things now and it appears as if there is jitter on the events.next() function which is apparent when you log an entry to the console every iteration. Sometimes the latency is more than a frame so I guess what I am seeing are dropped frames rather than a badly timed rotation function. There is quite a lot of variation in IdleArgs in the IdleEvent and I periodically get two idle events before an UpdateEvent. I don't really know what that means though. I am a little out of my depth here as I am not a graphics or game developer so I don't know how much help I can really be. If I log to the console in a simple 10ms delay loop on another thread I don't get any jitter so at least windows is not freezing the entire process periodically. Feel free to close this issue if you like as I doubt that I will be able to solve it. Regards, |
Hi, thanks for your great demo. I recorded the spinning square using a high framerate video camera (I used my phone at 240fps) and noticed that there is a brief pause every 10 frames or so. At normal speeds this manifests itself as a slightly jerky rotation. This happens on both low and high DPI screens but it is more obvious on high DPI screens because the square is sharper. I have a decent graphics card and cpu. Has anyone else noticed this?
The text was updated successfully, but these errors were encountered: