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

Improve X11 screen_get_refresh_rate performance #83902

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

Biokastin
Copy link
Contributor

@Biokastin Biokastin commented Oct 24, 2023

Merge request done in response to #73563

XRRGetScreenResources causes significant performance issues if called frequently causing X11 entirely to slow to a crawl. Using XRRGetScreenResourcesCurrent significantly reduces the severity of the issue though with a still noticeable mild jitter.

Multiple other projects seem to have done this same fix for the same problem.

Bugsquad edit:

@Biokastin Biokastin requested a review from a team as a code owner October 24, 2023 18:39
@Chaosus Chaosus added this to the 4.2 milestone Oct 24, 2023
@akien-mga akien-mga changed the title Improved X11 screen_get_refresh_rate performance Improve X11 screen_get_refresh_rate performance Oct 24, 2023
@akien-mga
Copy link
Member

CC @jordigcs who did the initial implementation in #57335.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Looks like a sensible change to me.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally, it works as expected. I don't notice any stuttering anymore, and the value reported is still 119.88.

@akien-mga akien-mga merged commit 06d5189 into godotengine:master Oct 25, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

Note for future contributions, we recommend using a dedicated feature branch instead of your fork's master branch, so that you can more easily maintain multiple PRs in parallel / rebase if need be.

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

Successfully merging this pull request may close these issues.

DisplayServer.screen_get_refresh_rate() is very slow if called continuously
4 participants