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

pegs CPU #108

Open
filbo opened this issue Jun 3, 2022 · 4 comments
Open

pegs CPU #108

filbo opened this issue Jun 3, 2022 · 4 comments

Comments

@filbo
Copy link

filbo commented Jun 3, 2022

When I am on the Globle tab in my browser, it pegs my CPU. Now granted my CPU is a wuss, but this still shouldn't be happening.

HW: Intel Core i3-4170 (2 cores + hypothreading @3.7GHz); 16GiB RAM; no GPU, just Intel's 'HD 4400' POS.
OS: LinuxMint 17.3 (oooold), 4.4.0-148-lowlatency kernel
Browser: Opera (dev branch) 88.0.4401.0, based on Chromium 102.0.4972.0

When Globle is on screen, it fluctuates between consuming 70 and 85% of CPU. Fan gets noisy. As soon as I switch away, it goes quiet. Acts as if it is either constantly redrawing the globe, or ... nevermind, I brought up the browser 'task manager' and it says 300% of one CPU is being used by 'GPU process'. So yes, constant redrawing.

I noticed that before I guessed anything, the globe was slowly rotating. So I guessed, which pinned the world in place. No difference, still 300% busy.

It's probably doing this on real machines too, it just isn't noticeable if you have a GPU with half a lung...

@the-abe-train
Copy link
Owner

The 3D globe is, like all games with a 3D component, inherently going to take up more CPU than a regular site. I'm not sure there's a solution to this other than using a 2D map instead of a globe, but I could be wrong. I'll leave this issue up so that if anyone has any ideas about how to reduce load on the CPU they can share here.

@filbo
Copy link
Author

filbo commented Jun 5, 2022

I haven't looked at how it's implemented. My question is basically, is it busy-looping drawing the globe repeatedly as fast as it can; or is it timer / event driven, drawing it only as-needed?

When it's rotating, conceptually it 'needs' to draw once per rotational increment. On a timer event, it would skip drawing any time the next increment wasn't due. So then the drawing equipment [CPU in my case, GPU in a 'real' system's case] would be idle except when a rotation was due.

When it's not rotating nor actively being zoomed, it never needs to redraw. This is not a live-action 3D FPS game! Yet it still sits there hammering the CPU (via 'GPU' process). So clearly there is some gain to be had. Recognize when this iteration's drawing parameters (rotation, zoom) are the same as last one's, and don't. The image on-screen isn't going anywhere, just let it be...

@epixian
Copy link

epixian commented Jun 6, 2022

You could do a quick sample for how long requestAnimationFrame takes on the user's browser and not auto-rotate if above a certain value.

@filbo
Copy link
Author

filbo commented Jun 7, 2022

It is not the auto-rotation. The CPU is pegged when the earth is sitting completely still.

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

No branches or pull requests

3 participants