-
-
Notifications
You must be signed in to change notification settings - Fork 440
[net7] Use high-resolution sleep primitives to enhance CPU efficiency #1599
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
Conversation
|
This has been heavily reworked in response to Discord discourse. This is now ready for review. |
|
I'm happy with this, thanks for writing the code also. It's a bit unclear to me right now how much we still want to support the whole "custom Run" idea? This would put the final nail in the coffin for this. (But we've added other features in the past that were in this direction) |
|
The thing is in 1.X Run was indeed fully custom, and made an explicit decision in 2.0 to regress here in the name of write-once-run-everywhere. There's nothing stopping our users implementing their own |
|
@Beyley @HurricanKai this builds now, is this good for merge? |
|
I think given this conflicts with custom |
If the user wants to customise this stuff they should implement the whole run loop themselves. This is the write-once-run-anywhere path where the fact that there is a while loop at all is an implementation detail. |
|
Fair enough - can we make the ShouldSpin virtual? Would that be a problem? That's less obvious but is at least an escape hatch? |
|
That'd be an API contract change and will probably need to go through the proposal system unless you disagree. I agree this would be a nice addition, but out of scope of this PR I think. |
|
Actually, the user should be able to opt-out of this behaviour. Thinking about things that need regular DoEvents calls, like rhythm games. |
* Proper frame timing in BreakneckSleep Should _lastTick be a property or left as a field? unsure * adjusted to feedback * forgot to make the example work too
|
This is going into draft, and would welcome being picked up by the community. This contains an experimental attempt at making our frame timing more CPU efficient by using high-resolution sleep primitives. However, we were unable to do so in a way that is consistent and that wasn't "jittery". Please see this Discord thread: https://discord.com/channels/521092042781229087/587346162802229298/1142876986537160865 This is now up for grabs |
|
Closing and adding to the community epic. |
No description provided.