Page 1 of 1

[0.16.51] High CPU usage while paused

Posted: Wed Aug 15, 2018 6:20 am
by duskwuff
Factorio uses a pretty significant amount of CPU time while inactive in the background, e.g. while no game is loaded, or in single-player mode with the pause menu or technology screen up. As best I can tell, this is because the game always redraws the screen at 60 fps, regardless of whether that's necessary or not.

As a point of reference, on my laptop (macOS 10.13.6), the game idles at roughly 16-17% CPU usage while sitting at the main menu, 25-30% while paused in-game, and as high as 35-40% while paused in the technology screen. Minimizing the window or hiding the application has no effect. (I can provide sampler results if it'd help.)

Is there some way this could be changed? It'd be great if the game could stopped redrawing (or drop the FPS to something trivially low) while paused and not in the foreground.

[edit: updated version number in title]

Re: [0.16.25] High CPU usage while paused

Posted: Wed Aug 15, 2018 7:38 am
by Bilka
Please update your game to the latest version and tell us if that changes anything.

Re: [0.16.51] High CPU usage while paused

Posted: Wed Aug 15, 2018 7:48 am
by duskwuff
Whoops -- I'm actually on 0.16.51; the version on the app bundle was just out of date somehow.

Re: [0.16.51] High CPU usage while paused

Posted: Wed Aug 15, 2018 8:40 am
by Zavian
Well on windows I get about 1% cpu load when on the pause screen. There was a bug causing factorio to busy wait around the time of version 0.16.25 (on windows, no idea whether that also affected OSX). Upload a log. Also what FPS are you getting ingame and whilst paused?

Re: [0.16.51] High CPU usage while paused

Posted: Wed Aug 15, 2018 8:49 am
by posila
The game stops redrawing only if you minimaze its window. Not being foreground window is too strict condition for it to stop redrawing.

Re: [0.16.51] High CPU usage while paused

Posted: Wed Aug 15, 2018 4:56 pm
by duskwuff
posila wrote:The game stops redrawing only if you minimaze its window.
Minimizing the window doesn't seem to have any effect either. I see similar CPU usage with the window minimized or hidden.

Re: [0.16.51] High CPU usage while paused

Posted: Wed Aug 15, 2018 6:10 pm
by Rseding91
duskwuff wrote:
posila wrote:The game stops redrawing only if you minimaze its window.
Minimizing the window doesn't seem to have any effect either. I see similar CPU usage with the window minimized or hidden.
It hasn't stopped rendering while minimized for a while now because the different operating systems can't reliably tell Factorio when it's actually minimized or not. It resulted in rendering stopping randomly while not minimized. Maybe that has changed in 0.17 with the new rendering that it could be put back.

Re: [0.16.51] High CPU usage while paused

Posted: Thu Aug 16, 2018 2:29 am
by Jap2.0
Can you post a screenshot with show-time-usage from the debug (F4) menu enabled and the game paused?

Re: [0.16.51] High CPU usage while paused

Posted: Thu Aug 16, 2018 3:11 am
by duskwuff
Here's a typical screenshot. CPU usage in this state is roughly 25%.

Re: [0.16.51] High CPU usage while paused

Posted: Sat May 04, 2019 9:52 am
by paulcsiki
Sorry for the necro-post. I am able to reproduce this every time on a mac. Open the game, load a saved game, pause the game, minimize the window and look in the activity monitor to see the CPU usage. See attached screenshots. It ranges from 11% to 20% for doing nothing. If it's not minimized (but still paused) then it consumes 49% CPU. My CPU is 2.9 GHz Intel Core i7 on a MBP 15' 2017.

See screenshots. Version: 0.17.36.