[0.12.33] Performance issues in entity update

Bugs that are actually features.
JasonC
Filter Inserter
Filter Inserter
Posts: 451
Joined: Tue Mar 22, 2016 3:05 am
Contact:

[0.12.33] Performance issues in entity update

Post by JasonC »

Windows 7, 64-bit.

In a map I am working on, I have a pretty large number of belts (~58,000 belt tiles). At some point while building some more, the game became sluggish and the UPS dropped to about 30-40. All of the time is being spent in "Entity Update".

However, if I do game.speed=2 in the console, the UPS doubles to 60-80. So, I think there is a problem here. My PC clearly has the processing power to run this map at > 60 UPS, but with game.speed=1, the game isn't running as fast as it can be, like some time is being wasted idling somewhere.

Another thing I noticed is with the game running at ~30 UPS, the "update" time in the timing stats is only about 18 ms, which should be about 55 UPS (~1 ms is spent in everything else according to the timing info).

So what I expected to happen was the game would continue to run at 60 UPS, but what actually happens is it runs much more slowly despite game.speed=2 being able to double the UPS. The ultimate consequence is I have to run this map at double speed with an inconsistent UPS bouncing around between 60 and 80, instead of normal speed with a stable 60.

I don't know what other info to provide.
Last edited by JasonC on Fri May 20, 2016 6:01 am, edited 1 time in total.
Took a break from 0.12.29 to 0.17.79, and then to ... oh god now it's 1.something. I never know what's happening.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15901
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.12.33] Performance issues in entity update

Post by Rseding91 »

Please post the save file and a screenshot with the debug timings enabled.
If you want to get ahold of me I'm almost always on Discord.
JasonC
Filter Inserter
Filter Inserter
Posts: 451
Joined: Tue Mar 22, 2016 3:05 am
Contact:

Re: [0.12.33] Performance issues in entity update

Post by JasonC »

Rseding91 wrote:Please post the save file and a screenshot with the debug timings enabled.
I couldn't get it back down to 30 but here is a screenshot at ~50 with game.speed=1. Increasing the game speed increases the UPS to > 60. Also a save is attached.

Image
Attachments
forumpost.zip
saved game
(16.84 MiB) Downloaded 91 times
Took a break from 0.12.29 to 0.17.79, and then to ... oh god now it's 1.something. I never know what's happening.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.12.33] Performance issues in entity update

Post by Choumiko »

The Flip looks a bit high, (also your FPS are lower than your UPS). I had a similiar issue with high Flip values lowering UPS (even on new maps) Have you tried lowering graphics memory usage from all to high/medium? That solved it for me
Rseding91
Factorio Staff
Factorio Staff
Posts: 15901
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.12.33] Performance issues in entity update

Post by Rseding91 »

What are your system specs?

As for the "runs faster when speed = 2" thing - that's because you're trading FPS for UPS. When the game speed is higher and it can't keep up it skips more frames. When it's lower it doesn't and so you end up spending more time rendering vs updating the game.

The entity update is only 1 part of the total time spent during a game tick. It also spends time preparing the frame-to-be-drawn which you can see under the top section "Render preparation".

Between "Update" and "Render preparation" that screenshot is saying it's spending 16.727 + 1.774 MS per game tick which is 18.501 MS. Add on to that a small (1 MS~) amount for things not covered by the timing statistics + the slight inaccuracy of measuring time from multiple sources and you reach roughly the UPS you're seeing in the screenshot.
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15901
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.12.33] Performance issues in entity update

Post by Rseding91 »

Also it looks like it is your computer: http://i.imgur.com/G3eB6nM.jpg
If you want to get ahold of me I'm almost always on Discord.
JasonC
Filter Inserter
Filter Inserter
Posts: 451
Joined: Tue Mar 22, 2016 3:05 am
Contact:

Re: [0.12.33] Performance issues in entity update

Post by JasonC »

Rseding91 wrote:As for the "runs faster when speed = 2" thing - that's because you're trading FPS for UPS. When the game speed is higher and it can't keep up it skips more frames. When it's lower it doesn't and so you end up spending more time rendering vs updating the game.

The entity update is only 1 part of the total time spent during a game tick. It also spends time preparing the frame-to-be-drawn which you can see under the top section "Render preparation".

Between "Update" and "Render preparation" that screenshot is saying it's spending 16.727 + 1.774 MS per game tick which is 18.501 MS. Add on to that a small (1 MS~) amount for things not covered by the timing statistics + the slight inaccuracy of measuring time from multiple sources and you reach roughly the UPS you're seeing in the screenshot.
Ah, that all makes sense now, thanks. Now I see game speed sets the ratio of updates to renders.
What are your system specs?
2.3 ghz i5-2410M, 4GB ram (1.3 ghz, ddr3), no swap, Intel HD 3000 integrated graphics, running Windows 7, 64-bit, display 1440x900.

Still dreaming of a new laptop... one of these days :lol:
Choumiko wrote:Have you tried lowering graphics memory usage from all to high/medium? That solved it for me
Yeah, that doesn't really affect performance for me unfortunately. Integrated graphics = it's all using system memory anyways.
Took a break from 0.12.29 to 0.17.79, and then to ... oh god now it's 1.something. I never know what's happening.
Post Reply

Return to “Not a bug”