Skip to content
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

[F.Rq.] Alternate implementation(s) for NullEmulator.FrameAdvance #4128

Open
YoshiRulz opened this issue Nov 27, 2024 · 2 comments
Open

[F.Rq.] Alternate implementation(s) for NullEmulator.FrameAdvance #4128

YoshiRulz opened this issue Nov 27, 2024 · 2 comments
Labels
App: EmuHawk Relating to EmuHawk frontend Enhancement For feature requests or possible improvements

Comments

@YoshiRulz
Copy link
Member

YoshiRulz commented Nov 27, 2024

Currently, it sleeps for 5 ms:

public bool FrameAdvance(IController controller, bool render, bool renderSound)
{
// real cores wouldn't do something like this, but this just keeps speed reasonable
// if all throttles are off
Thread.Sleep(5);
return true;
}

I'm thinking it could be helpful for S–N ratio in profiling if it did something else, namely return instantly. Other options are Thread.Sleep(0) or a busy loop.

@YoshiRulz YoshiRulz added Enhancement For feature requests or possible improvements App: EmuHawk Relating to EmuHawk frontend labels Nov 27, 2024
@Morilli
Copy link
Collaborator

Morilli commented Nov 28, 2024

I'm not sure how much use that would have for profiling because most other things aren't setup anyway, like controls are just NullController, video output is just an empty screen, no audio, no memory domains etc.

@YoshiRulz
Copy link
Member Author

YoshiRulz commented Nov 28, 2024

That's the idea. It shouldn't be allocating, and the flame graph shouldn't include any managed codepaths except the ones for sleeping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App: EmuHawk Relating to EmuHawk frontend Enhancement For feature requests or possible improvements
Projects
None yet
Development

No branches or pull requests

2 participants