UPS limit with high game speed?

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
Cubius
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Aug 03, 2019 1:09 pm
Contact:

UPS limit with high game speed?

Post by Cubius »

So I've increased my game speed with

Code: Select all

/c game.speed = #
since I want to drain a 40M copper deposit that's in the way of my new steel production line a bit faster.
The issue is, when I set my game speed to higher values, starting at 5, my UPS seem to be capped around 250, when it should go up to 300.
My CPU is chilling around 25% while my GPU is about to fall asleep at 20% or lower. Oh, and my RAM usage is about 3GB of 32GB (plus another 2GB from the 50 tabs I have open in Firefox, googling Factorio stuff).
So, clearly I should be able to get higher performance with my hardware, but the best I can get is about 270 UPS while standing perfectly still in the middle of nowhere, fully zoomed in on my character.
Any ideas what's bottlenecking my factory game?

Koub
Global Moderator
Global Moderator
Posts: 7198
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: UPS limit with high game speed?

Post by Koub »

The game is only slightly multithreaded, but mostly monothreaded. Don't expect your CPU go 100% unless it's a monocore :)
Koub - Please consider English is not my native language.

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

Re: UPS limit with high game speed?

Post by Loewchen »

Cubius wrote:
Sat Aug 03, 2019 1:29 pm
Any ideas what's bottlenecking my game?
Your CPU.

Cubius
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Aug 03, 2019 1:09 pm
Contact:

Re: UPS limit with high game speed?

Post by Cubius »

Koub wrote:
Sat Aug 03, 2019 1:58 pm
The game is only slightly multithreaded, but mostly monothreaded. Don't expect your CPU go 100% unless it's a monocore :)
Yeah, I see what you mean, apparently core #0 is at 100% while the other 7 cores are not being used at all.
I could overclock, but that wouldn't yield a big increase in performance either.
I don't suppose the devs will go to the trouble of making it multithreaded this late in development.
It's a shame, but thanks for the info!

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

Re: UPS limit with high game speed?

Post by Jap2.0 »

Cubius wrote:
Sat Aug 03, 2019 5:29 pm
I don't suppose the devs will go to the trouble of making it multithreaded this late in development.
They've tried. (And a couple things - notably some rendering-related stuff and fluid processing - are.)

It ran into a couple issues: the first being that a lot of stuff is closely tied together and has to be deterministic (i.e. run exactly the same way every time, regardless of core count, etc.), and the second being that memory latency is an issue only shortly after cpu.
There are 10 types of people: those who get this joke and those who don't.

Cubius
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Aug 03, 2019 1:09 pm
Contact:

Re: UPS limit with high game speed?

Post by Cubius »

So I've stumbled upon the option to allow increased zoom at the bottom of the debug menu. This increased my UPS to around 400-450 (it's fluctuating quite a bit now) when fully zoomed in.
Furthermore I've read a little on multithreading and the real culprits are the belts, which are not multithreaded but apparently there's a highly efficient single-thread solution (see viewtopic.php?p=238247#p238247). Supposedly memory bandwidth is the real limiting factor, although I couldn't find a good way to monitor that.

Koub
Global Moderator
Global Moderator
Posts: 7198
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: UPS limit with high game speed?

Post by Koub »

Cubius wrote:
Sat Aug 03, 2019 5:29 pm
I don't suppose the devs will go to the trouble of making it multithreaded this late in development.
You might want to have a look at that topic : viewtopic.php?f=5&t=39893
If it's too long, just read the devs' answers, they are full of useful info.
Also IIRC, the subject has been mentioned in some FFF :
Koub - Please consider English is not my native language.

Cubius
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Aug 03, 2019 1:09 pm
Contact:

Re: UPS limit with high game speed?

Post by Cubius »

Jap2.0 wrote:
Sat Aug 03, 2019 5:35 pm
They've tried. (And a couple things - notably some rendering-related stuff and fluid processing - are.)

It ran into a couple issues: the first being that a lot of stuff is closely tied together and has to be deterministic (i.e. run exactly the same way every time, regardless of core count, etc.), and the second being that memory latency is an issue only shortly after cpu.
Yeah, I've recently had the (dis)pleasure of doing a project that required multithreading. I would imagine that performance might suffer a bit if you have to have threads interacting. I can imagine all sorts of glitches and bugs from stuff not being executed in the same thread.

Cubius
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Aug 03, 2019 1:09 pm
Contact:

Re: UPS limit with high game speed?

Post by Cubius »

Koub wrote:
Sat Aug 03, 2019 10:39 pm
You might want to have a look at that topic : viewtopic.php?f=5&t=39893
If it's too long, just read the devs' answers, they are full of useful info.
Also IIRC, the subject has been mentioned in some FFF :
Yeah, that's the same post I dug up.
I just read the FFF (from November 2017) which states the obvious, that getting a bunch of threads to peacefully coexist and be productive at the same time is a real hassle and if they were going to go to the trouble of doing it, it would be a single big update. And given that it's been well over a year and that changes on such a fundamental level will most likely not get easier over time as you write more and more code, I wouldn't bet on this.
I guess I should consider myself lucky that I haven't had to deal with cache invalidation myself yet, but yeah, TIL that cache invalidation is a thing...
Anyway, I appreciate the help!

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

Re: UPS limit with high game speed?

Post by Zavian »

If you haven't seen it already you should read viewtopic.php?f=5&t=39893&start=60#p238247. (Harkonnen was a factorio dev at that time).

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2420
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: UPS limit with high game speed?

Post by BlueTemplar »

holy hell
so, about that tatoo...
BobDiggity (mod-scenario-pack)

Post Reply

Return to “Technical Help”