[0.16.51] High CPU usage while paused

Bugs that we were not able to reproduce, and/or are waiting for more detailed info.
Post Reply
duskwuff
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Aug 15, 2018 1:36 am
Contact:

[0.16.51] High CPU usage while paused

Post 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]
Last edited by duskwuff on Wed Aug 15, 2018 7:47 am, edited 1 time in total.

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.16.25] High CPU usage while paused

Post by Bilka »

Please update your game to the latest version and tell us if that changes anything.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

duskwuff
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Aug 15, 2018 1:36 am
Contact:

Re: [0.16.51] High CPU usage while paused

Post by duskwuff »

Whoops -- I'm actually on 0.16.51; the version on the app bundle was just out of date somehow.

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: [0.16.51] High CPU usage while paused

Post 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?

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.16.51] High CPU usage while paused

Post 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.

duskwuff
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Aug 15, 2018 1:36 am
Contact:

Re: [0.16.51] High CPU usage while paused

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] High CPU usage while paused

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Jap2.0
Smart Inserter
Smart Inserter
Posts: 2339
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: [0.16.51] High CPU usage while paused

Post by Jap2.0 »

Can you post a screenshot with show-time-usage from the debug (F4) menu enabled and the game paused?
There are 10 types of people: those who get this joke and those who don't.

duskwuff
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Aug 15, 2018 1:36 am
Contact:

Re: [0.16.51] High CPU usage while paused

Post by duskwuff »

Here's a typical screenshot. CPU usage in this state is roughly 25%.
Attachments
Screen Shot 2018-08-15 at 20.04.20.png
Screen Shot 2018-08-15 at 20.04.20.png (1.41 MiB) Viewed 3091 times

User avatar
paulcsiki
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sun Apr 21, 2019 12:45 pm
Contact:

Re: [0.16.51] High CPU usage while paused

Post 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.
Attachments
Screenshot 2019-05-04 at 10.54.49.png
Screenshot 2019-05-04 at 10.54.49.png (10.81 MiB) Viewed 2528 times
Screenshot 2019-05-04 at 10.51.29.png
Screenshot 2019-05-04 at 10.51.29.png (1.51 MiB) Viewed 2531 times
Screenshot 2019-05-04 at 10.50.28.png
Screenshot 2019-05-04 at 10.50.28.png (1.54 MiB) Viewed 2531 times
Screenshot 2019-05-04 at 10.49.26.png
Screenshot 2019-05-04 at 10.49.26.png (1.5 MiB) Viewed 2531 times

Post Reply

Return to “Pending”