Page 1 of 1
UPS limit with high game speed?
Posted: Sat Aug 03, 2019 1:29 pm
by Cubius
So I've increased my game speed with
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?
Re: UPS limit with high game speed?
Posted: Sat Aug 03, 2019 1:58 pm
by Koub
The game is only slightly multithreaded, but mostly monothreaded. Don't expect your CPU go 100% unless it's a monocore

Re: UPS limit with high game speed?
Posted: Sat Aug 03, 2019 5:22 pm
by Loewchen
Cubius wrote: Sat Aug 03, 2019 1:29 pm
Any ideas what's bottlenecking my game?
Your CPU.
Re: UPS limit with high game speed?
Posted: Sat Aug 03, 2019 5:29 pm
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!
Re: UPS limit with high game speed?
Posted: Sat Aug 03, 2019 5:35 pm
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.
Re: UPS limit with high game speed?
Posted: Sat Aug 03, 2019 10:36 pm
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.
Re: UPS limit with high game speed?
Posted: Sat Aug 03, 2019 10:39 pm
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 :
Re: UPS limit with high game speed?
Posted: Sat Aug 03, 2019 10:44 pm
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.
Re: UPS limit with high game speed?
Posted: Sat Aug 03, 2019 10:59 pm
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!
Re: UPS limit with high game speed?
Posted: Sun Aug 04, 2019 1:31 am
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).
Re: UPS limit with high game speed?
Posted: Sun Aug 04, 2019 1:59 pm
by BlueTemplar
holy hell
so, about that tatoo...