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

Update outdated low_processor_usage_mode doc #90785

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

jsjtxietian
Copy link
Contributor

For #90774

Should we also remove This is meant for writing applications and editors, but is pretty useless (and can hurt performance) in most games since it mentioned it can be used to save battery

@jsjtxietian jsjtxietian requested a review from a team as a code owner April 17, 2024 09:05
@akien-mga akien-mga requested a review from Calinou April 17, 2024 09:06
@akien-mga akien-mga added this to the 4.3 milestone Apr 17, 2024
@akien-mga akien-mga added cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Apr 17, 2024
@KoBeWi
Copy link
Member

KoBeWi commented Apr 17, 2024

but is pretty useless (and can hurt performance) in most games

I think what this means is that in games there is almost always something moving (even in menu you can have animated background), so low processor mode will have very little effect. Not sure about the performance claim.

@jsjtxietian
Copy link
Contributor Author

Not sure about the performance claim.

IMHO it means that you will feel laggy if the calculated dynamic_delay is noticeable.

       if (max_fps > 0 && !Engine::get_singleton()->is_editor_hint()) {
		// Override the low processor usage mode sleep delay if the target FPS is lower.
		dynamic_delay = MAX(dynamic_delay, (uint64_t)(1000000 / max_fps));
	}

	if (dynamic_delay > 0) {
		target_ticks += dynamic_delay;
		uint64_t current_ticks = get_ticks_usec();

		if (current_ticks < target_ticks) {
			delay_usec(target_ticks - current_ticks);
		}

		current_ticks = get_ticks_usec();
		target_ticks = MIN(MAX(target_ticks, current_ticks - dynamic_delay), current_ticks + dynamic_delay);
	}

Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's my whole suggestion so of course I agree.

@akien-mga akien-mga merged commit 09a5708 into godotengine:master Jun 24, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants