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

Reduce frequency of timeout checks by 10+ times #3628

Merged
merged 1 commit into from
Mar 13, 2021

Conversation

adrian17
Copy link
Collaborator

@adrian17 adrian17 commented Mar 12, 2021

In some games (meat boy) instant::now() was taking 10+% of tick time (and that wasn't even the full recorded overhead of the check), so this still needed to be tuned down. In the future, if other actions become faster, this might need to be tuned down even more.

Why "10+ times"? Because if a small function runs between 200 and 2000 actions, its # of checks will drop to 0.

That raises a side question: should actions_since_timeout_check be stored in Context instead of Activation? In practice, I feel like this isn't an issue, as even if an inifinite loop span across a deep call stack, the outermost frame with the loop will amass 2000 actions at some point, right? So the current approach of storing in Activation might even be better as it decreases the frequency of checks without making them weaker.

Alternatively, just put it in Context and bump the number even more.

@Herschel
Copy link
Member

Thanks! My instinct is that this would be better in Context, but probably not a huge deal, as you mention. Wondering if we should also up the default timeout from 15s as well as we sadly hit this quite often on some machines/content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants