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

High CPU consumption when in different workspace #7

Open
claudiocabral opened this issue Dec 13, 2015 · 2 comments
Open

High CPU consumption when in different workspace #7

claudiocabral opened this issue Dec 13, 2015 · 2 comments
Assignees

Comments

@claudiocabral
Copy link
Contributor

In OS X CPU consumption goes to 100% if etudes is minimized or in a virtual desktop that's not being displayed.

@claudiocabral claudiocabral changed the title High CPU consumption when in different workspace (OS X) High CPU consumption when in different workspace Dec 13, 2015
@drlight-code
Copy link
Member

As discussed, it seems that GLFW will return immediately from glfwSwapBuffers if the window is not visible. What we should do here is remember the time after the last buffer swap, and if we return early put the thread to sleep for the difference to 1/60s for a 60Hz framerate, which we also get with the regular vsynced buffer swap.

@drlight-code drlight-code self-assigned this Dec 13, 2015
@drlight-code
Copy link
Member

This issue is reported in GLFW: glfw/glfw#680
It affects only Mac OS X and is somehow related to, or can be circumvented by the "App Nap" feature. We will for now not be dealing with this ourselves in etudes. We might suspend the rendering when the window is minimized, however it also occurs if the window is fully obstructed by another window, and I don't see an easy way how to deal with that. We might introduce a global framerate throttling of 90-100Hz or so, however, so I'll keep the issue open for now.

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

No branches or pull requests

2 participants