[0.15.26] High CPU usage when paused.

Bugs that are actually features.
Post Reply
lxx
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jul 03, 2017 5:35 am
Contact:

[0.15.26] High CPU usage when paused.

Post by lxx »

I am playing Factorio on a notebook. Sometimes I can only play some minutes at a time, so I usually leave it running, but paused. Since Factorio's CPU usage doesn't seem to reduce when paused, this keeps the fan spinning all the time, and the notebook gets quite warm. Would be nice if Factorio could reduce its CPU usage while paused.

Running with vsync disabled on Linux, X with Intel/modesetting driver.

This issue is not new in 0.15.18, it happened in all the versions before (that I played). So at least 0.14 and 0.13 as well.

Edit: CPU usage does go down when paused, but is still somewhat high. vsync doesn't seem to make a difference.
Last edited by lxx on Tue Jul 04, 2017 6:50 am, edited 2 times in total.

Loewchen
Global Moderator
Global Moderator
Posts: 8317
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by Loewchen »

Update to 15.26 and post the log please.

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by mrvn »

If you are playing under Linux I suggest starting factorio from a terminal and pressing ctrl-z to really pause the game and then "fg" to unpause it.

sillyfly
Smart Inserter
Smart Inserter
Posts: 1099
Joined: Sun May 04, 2014 11:29 am
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by sillyfly »

mrvn wrote:If you are playing under Linux I suggest starting factorio from a terminal and pressing ctrl-z to really pause the game and then "fg" to unpause it.


This will work, but is more of a "patch", and it may have undesired side-effects (Factorio has issues in Windows when locking / switching users / resuming from sleep - I'm guessing similar things may happen when backgrounding under Linux).

Assuming most of the processing power is in the actual game simulation you would expect the CPU usage to drop significantly when the game is paused. If it doesn't - maybe there's a problem somewhere? (Or perhaps the architecture of the game/engine makes it much simpler to "run the simulation on idle" when paused... I can see this being the case).

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

Re: [0.15.18] High CPU usage when paused.

Post by Rseding91 »

The game simulation is paused when the game is paused so any CPU usage you're seeing is rendering and processing of input. I can't speak for the linux build but on Windows when I pause the game the CPU usage drops to almost nothing.
If you want to get ahold of me I'm almost always on Discord.

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by mrvn »

By the way, what do you mean by "pause the game"? Just opening the game menu?

lxx
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jul 03, 2017 5:35 am
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by lxx »

Loewchen wrote:Update to 15.26 and post the log please.
There you go.
Attachments
factorio-current.log
Factorio Log
(2.81 KiB) Downloaded 80 times

lxx
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jul 03, 2017 5:35 am
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by lxx »

mrvn wrote:If you are playing under Linux I suggest starting factorio from a terminal and pressing ctrl-z to really pause the game and then "fg" to unpause it.
Well, I'm sending kill -STOP/-CONT, but the result should be the same. But it's a bit tedious.

lxx
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jul 03, 2017 5:35 am
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by lxx »

mrvn wrote:By the way, what do you mean by "pause the game"? Just opening the game menu?
Shift+Space, for me the that's binding for "Pause game" in the Options/Controls/Game. But it's about the same in the menu, I think.

lxx
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jul 03, 2017 5:35 am
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by lxx »

Rseding91 wrote:The game simulation is paused when the game is paused so any CPU usage you're seeing is rendering and processing of input. I can't speak for the linux build but on Windows when I pause the game the CPU usage drops to almost nothing.
Well, my notebook (Haswell with on-chip GPU), is not very fast. The game runs acceptably, but when it's paused and in the background, it still eats ~50% of one CPU, which results in a lot of heat and fan noise.

That being sad, pausing the game results in a lower CPU usage. When playing it's easily >100%.

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by mrvn »

Yeah, it's still drawing 60 fps. On my old low end desktop the FPS actually goes way up when I pause the game. All the time saved by not doing ticks goes into frame redraws. Playing I didn't get 60 fps, paused I do.

rorror
Fast Inserter
Fast Inserter
Posts: 241
Joined: Fri Nov 21, 2014 9:02 pm
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by rorror »

I noticed this too. I think this was not happend in v0.14

When fully Zoomed In, and game is paused, it uses 4% cpu.
paused zoomed in.PNG
paused zoomed in.PNG (751.17 KiB) Viewed 5396 times
When fully zoomed Out, the game uses in paused mode about 19%..
paused_mode.PNG
paused_mode.PNG (1.19 MiB) Viewed 5396 times

Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by Oxyd »

The game still renders when it's paused, so that takes some amount of CPU. If your hardware is not very fast, this might cause considerable CPU load.

Make sure you don't have any of the debug options enabled – they can take a lot of CPU to process.

rorror
Fast Inserter
Fast Inserter
Posts: 241
Joined: Fri Nov 21, 2014 9:02 pm
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by rorror »

Oxyd wrote:The game still renders when it's paused, so that takes some amount of CPU. If your hardware is not very fast, this might cause considerable CPU load.

Make sure you don't have any of the debug options enabled – they can take a lot of CPU to process.
With the debug off (it did for me only show ups fps, does for me not change cpu %)

When i play the game on full zoom window it uses 25%cpu (60fps/60ups), paused 19/20% cpu.
I find pausing the game resulting only in 5/6% cpu drop very poor.

Thats 1/5 of total cpu usage, that is removed while in paused mode.

Intel i7 3630QM 2.4ghz.


Well i found a work around to get it to use less cpu, i need to zoom in to maximum, en then pause the game.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by kovarex »

rorror wrote:
Oxyd wrote:The game still renders when it's paused, so that takes some amount of CPU. If your hardware is not very fast, this might cause considerable CPU load.

Make sure you don't have any of the debug options enabled – they can take a lot of CPU to process.
With the debug off (it did for me only show ups fps, does for me not change cpu %)

When i play the game on full zoom window it uses 25%cpu (60fps/60ups), paused 19/20% cpu.
I find pausing the game resulting only in 5/6% cpu drop very poor.

Thats 1/5 of total cpu usage, that is removed while in paused mode.

Intel i7 3630QM 2.4ghz.


Well i found a work around to get it to use less cpu, i need to zoom in to maximum, en then pause the game.
Well, the rendering is not for free, and it is multithreaded, so it can take more cpu easily.

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by mrvn »

kovarex wrote:
rorror wrote:
Oxyd wrote:The game still renders when it's paused, so that takes some amount of CPU. If your hardware is not very fast, this might cause considerable CPU load.

Make sure you don't have any of the debug options enabled – they can take a lot of CPU to process.
With the debug off (it did for me only show ups fps, does for me not change cpu %)

When i play the game on full zoom window it uses 25%cpu (60fps/60ups), paused 19/20% cpu.
I find pausing the game resulting only in 5/6% cpu drop very poor.

Thats 1/5 of total cpu usage, that is removed while in paused mode.

Intel i7 3630QM 2.4ghz.


Well i found a work around to get it to use less cpu, i need to zoom in to maximum, en then pause the game.
Well, the rendering is not for free, and it is multithreaded, so it can take more cpu easily.
It should be nearly free. Simply create a texture of the screen when pausing or opening menues and use that as background instead of compositing the whole frame 60 times a second. And only refresh the screen when something changes.

lxx
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jul 03, 2017 5:35 am
Contact:

Re: [0.15.18] High CPU usage when paused.

Post by lxx »

kovarex wrote:Well, the rendering is not for free, and it is multithreaded, so it can take more cpu easily.
True that. But, maybe things can be optimized. Maybe render at a lower FPS when in menu/paused, if there's no input… or try to detect when the window is not visible and then skip the rendering.

Post Reply

Return to “Not a bug”