Understanding Factorio Performance

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
Xeteth
Fast Inserter
Fast Inserter
Posts: 158
Joined: Tue Feb 17, 2015 6:06 am
Contact:

Understanding Factorio Performance

Post by Xeteth »

I am currently working on a rather large world in Factorio (~70mb filesize, 28k turrets, 27k inserters, 10k solar/accumulator, ~80k rail segments, etc. etc.) and I am currently seeing a FPS/UPS of ~11/35.

Now, as to be expected with a world this size even with some pretty decent hardware one cannot expect to get a solid 60 FPS/UPS. I am however a little confused about performance etc. and whether or not my hardware is actually being pushed to the limit by Factorio.

When I open the task manager my CPU usage for Factorio hovers around 14% and memory used is about 2500mb. Is this normal and to be expected? I had somehow assumed that performance drops (for UPS anyway) would only really be seen when the CPU was being pushed to the limit (80+% CPU usage) or am I completely wrong?

I understand that there are a lot of optimisations on the way in 0.12 which will no doubt help; however was just wondering if someone was able to shed some light on why I am seeing performance drops when the hardware isn't being stressed too hard (have I screwed up settings somewhere in my system?) or whether this is normal.

For reference my system specs are:
Intel Core i7-2600 CPU @ 3.40 GHz
24GB DDR3 Ram
Palit Nvidia GeForce GTX770 4GB
Gigabyte G1 Sniper M3 Motherboard


Here is a screenshot of the in game detailed information when my game is running if that helps at all:
Image

Any info is much appreciated!

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Understanding Factorio Performance

Post by DaveMcW »

Factorio only uses 1 cpu core. Your quad-core processor is stuck at 75% idle.

Making the game truly multi-threaded is on the wishlist, but after all the easier optimizations have been done.

Lee_newsum
Filter Inserter
Filter Inserter
Posts: 436
Joined: Wed Jan 15, 2014 9:41 am
Contact:

Re: Understanding Factorio Performance

Post by Lee_newsum »

one more think to note is that factorio eats VRAM a lot because the way is runs (window mode) you OS have 1-2GB VRAM and game at star 1/2 - 1 GB VRAM and all the items you put on the map eat some more.
this is the same as DaveMcW sed the think to note is that the CPU or VRAM are the bottleneck a system runs out of one FPS gos down.

keyboardhack
Filter Inserter
Filter Inserter
Posts: 478
Joined: Sat Aug 23, 2014 11:43 pm
Contact:

Re: Understanding Factorio Performance

Post by keyboardhack »

Lee_newsum wrote:one more think to note is that factorio eats VRAM a lot because the way is runs (window mode) you OS have 1-2GB VRAM and game at star 1/2 - 1 GB VRAM and all the items you put on the map eat some more.
this is the same as DaveMcW sed the think to note is that the CPU or VRAM are the bottleneck a system runs out of one FPS gos down.
This is incorrect. Factorio uses a fixed amount of vram. Vanilla factorio uses ~500mb of vram and it doesn't change while you play the game, no matter how many items there is in your map. As DaveMcW said then factorio is mostly running on one core and that's the usual bottleneck.
Waste of bytes : P

Lee_newsum
Filter Inserter
Filter Inserter
Posts: 436
Joined: Wed Jan 15, 2014 9:41 am
Contact:

Re: Understanding Factorio Performance

Post by Lee_newsum »

keyboardhack wrote:
Lee_newsum wrote:one more think to note is that factorio eats VRAM a lot because the way is runs (window mode) you OS have 1-2GB VRAM and game at star 1/2 - 1 GB VRAM and all the items you put on the map eat some more.
this is the same as DaveMcW sed the think to note is that the CPU or VRAM are the bottleneck a system runs out of one FPS gos down.
This is incorrect. Factorio uses a fixed amount of vram. Vanilla factorio uses ~500mb of vram and it doesn't change while you play the game, no matter how many items there is in your map. As DaveMcW said then factorio is mostly running on one core and that's the usual bottleneck.
no you are incorrect if one item is the size of 511Kb have 10000 on them is 511kB * 10000= 5110000 and that is a lot of VRAM to see them.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Understanding Factorio Performance

Post by orzelek »

Lee_newsum wrote:
keyboardhack wrote:
Lee_newsum wrote:one more think to note is that factorio eats VRAM a lot because the way is runs (window mode) you OS have 1-2GB VRAM and game at star 1/2 - 1 GB VRAM and all the items you put on the map eat some more.
this is the same as DaveMcW sed the think to note is that the CPU or VRAM are the bottleneck a system runs out of one FPS gos down.
This is incorrect. Factorio uses a fixed amount of vram. Vanilla factorio uses ~500mb of vram and it doesn't change while you play the game, no matter how many items there is in your map. As DaveMcW said then factorio is mostly running on one core and that's the usual bottleneck.
no you are incorrect if one item is the size of 511Kb have 10000 on them is 511kB * 10000= 5110000 and that is a lot of VRAM to see them.
keyboardhack is correct on this one.
VRAM usage will depend on graphical settings and mods installed.

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: Understanding Factorio Performance

Post by SilverWarior »

DaveMcW wrote:Factorio only uses 1 cpu core. Your quad-core processor is stuck at 75% idle.
WRONG!
Multithreading was already implemented in Factorio 0.6.2
https://forums.factorio.com/forum/vie ... ding#p8336

Now it is possible that if the OP was upgrading its Factorio game from previous versions to the newest the old settings were preserved and therefore settings are set to only use one core.
I suggest checking the game options for "Max threads" option and set it to desired number of threads the game should use.

FishSandwich
Smart Inserter
Smart Inserter
Posts: 1847
Joined: Sun Feb 23, 2014 3:37 pm
Contact:

Re: Understanding Factorio Performance

Post by FishSandwich »

SilverWarior wrote:
DaveMcW wrote:Factorio only uses 1 cpu core. Your quad-core processor is stuck at 75% idle.
WRONG!
Multithreading was already implemented in Factorio 0.6.2
https://forums.factorio.com/forum/vie ... ding#p8336

Now it is possible that if the OP was upgrading its Factorio game from previous versions to the newest the old settings were preserved and therefore settings are set to only use one core.
I suggest checking the game options for "Max threads" option and set it to desired number of threads the game should use.
Multithreading doesn't mean multiple cores are used.

User avatar
Kewlhotrod
Fast Inserter
Fast Inserter
Posts: 168
Joined: Thu Apr 23, 2015 5:20 pm
Contact:

Re: Understanding Factorio Performance

Post by Kewlhotrod »

orzelek wrote:
Lee_newsum wrote:
keyboardhack wrote:
Lee_newsum wrote: VRAM usage will depend on graphical settings and mods installed.
idk what the flying fack hes talking about, he might be confusing it with regular random access memory (RAM) because I have a save over 200hours long and it only uses 600mb of vram on a r9 280.

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: Understanding Factorio Performance

Post by SilverWarior »

Lee_newsum wrote:
keyboardhack wrote:
Lee_newsum wrote:one more think to note is that factorio eats VRAM a lot because the way is runs (window mode) you OS have 1-2GB VRAM and game at star 1/2 - 1 GB VRAM and all the items you put on the map eat some more.
this is the same as DaveMcW sed the think to note is that the CPU or VRAM are the bottleneck a system runs out of one FPS gos down.
This is incorrect. Factorio uses a fixed amount of vram. Vanilla factorio uses ~500mb of vram and it doesn't change while you play the game, no matter how many items there is in your map. As DaveMcW said then factorio is mostly running on one core and that's the usual bottleneck.
no you are incorrect if one item is the size of 511Kb have 10000 on them is 511kB * 10000= 5110000 and that is a lot of VRAM to see them.
I think you don't understand correctly how VRAM is used.

VRAM which stands for Video Rapid Access Memory is used to store textures of different ingame items.
So for instance a ore chunk has one texture stored no mater how many ore chunks are shown on the map. And since the game currently contains four different ores there are four different textures for ore chunks stored in VRAM.
More complex ingame items like machines have a bit different textures. For instance a machine texture actually contains multiple images of the machine in order to be able to play the machine information. Each machine information is stored in its own tile within that texture.
Now some items like inserters are even composed from multiple textures.

Anyway the number of textures stored in VRAM depends on number of possible different items in game and not on the number of placed item on the map.

Also there is some additional VRAM memory used to store several buffered textures where each of these textures represent one scene layer. Several layers that I know the game use (I probably don't know all of them) are:
- ground tiles
- decals
- transport belts and rails
- ground items
- machines and forests
- player and biters
- flying robots
When the final screen output is rendered they are drawn one after another probably in same order I have listed them using transparency.
Why are these textures/layers used? So that you don't need to recompose every part of game screen from bunch of smaller textures especially if it hasn't changed from last rendering. If implemented properly you can save huge amount of graphical processing with this.
Now all of these textures are of the same size that is the monitor resolution or game window size. That is why playing game on higher resolutions quickly raises the VRAM usage.

There is at least another texture/layer that the game stores and is used for light rendering but as far as I know this texture is not screen resolution dependent. this texture is then used in comparison with special shaders to make parts of screen darker or lighter so you can simulate night time.

I hope this might help you better understand the VRAM usage. If not please specify which part is not understandable and I'll try to explain in better detail.

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: Understanding Factorio Performance

Post by SilverWarior »

FishSandwich wrote:Multithreading doesn't mean multiple cores are used.
True. The OS can still decide that all of those threads are processed with only one core but this is uncommon.
Sure you can develop your application to request the OS to run specific thread on specific core but with newer versions of Windows this is no guarantee that specific tread will indeed be processed by desired code. You could only be sure of this on Windows 2000 and Windows XP.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Understanding Factorio Performance

Post by orzelek »

SilverWarior wrote:
FishSandwich wrote:Multithreading doesn't mean multiple cores are used.
True. The OS can still decide that all of those threads are processed with only one core but this is uncommon and can only be achieved by specifying custom process affinity which the Factorio as as I know does not.
I think that Fish mainly meant that you get two main threads - game loop and potentially render thread. So your performance is still limited by performance of single core (thats why I have i7-4790K CPU :D ). More threads can be used for stuff like sound/music but they don't actually do a lot of work.

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: Understanding Factorio Performance

Post by SilverWarior »

orzelek wrote:I think that Fish mainly meant that you get two main threads - game loop and potentially render thread. So your performance is still limited by performance of single core (thats why I have i7-4790K CPU :D ). More threads can be used for stuff like sound/music but they don't actually do a lot of work.
Actually Factorio is quite good in splitting most of slow and demanding work (path finding, belt simulation, etc.) into multiple threads. So people with multicore computers can really notice the difference.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Understanding Factorio Performance

Post by orzelek »

SilverWarior wrote:
orzelek wrote:I think that Fish mainly meant that you get two main threads - game loop and potentially render thread. So your performance is still limited by performance of single core (thats why I have i7-4790K CPU :D ). More threads can be used for stuff like sound/music but they don't actually do a lot of work.
Actually Factorio is quite good in splitting most of slow and demanding work (path finding, belt simulation, etc.) into multiple threads. So people with multicore computers can really notice the difference.
I'm not sure where your information comes from... but from what I've read all simulation needs to be constrained to single game loop - not sure if this includes pathfinder. Other thing is that I haven't seen game exceed 12-13% cpu usage listed which means it can saturate one core but not more.

starholme
Fast Inserter
Fast Inserter
Posts: 201
Joined: Tue Oct 21, 2014 7:25 pm
Contact:

Re: Understanding Factorio Performance

Post by starholme »

orzelek wrote:
SilverWarior wrote:
orzelek wrote:I think that Fish mainly meant that you get two main threads - game loop and potentially render thread. So your performance is still limited by performance of single core (thats why I have i7-4790K CPU :D ). More threads can be used for stuff like sound/music but they don't actually do a lot of work.
Actually Factorio is quite good in splitting most of slow and demanding work (path finding, belt simulation, etc.) into multiple threads. So people with multicore computers can really notice the difference.
I'm not sure where your information comes from... but from what I've read all simulation needs to be constrained to single game loop - not sure if this includes pathfinder. Other thing is that I haven't seen game exceed 12-13% cpu usage listed which means it can saturate one core but not more.
I have to agree with Orzelek, playing factorio on my old quad core(Q9550), I see my ups/fps start dropping long before I get to even 50% processor usage. Single thread performance is king for games like factorio.

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: Understanding Factorio Performance

Post by SilverWarior »

orzelek wrote:I'm not sure where your information comes from... but from what I've read all simulation needs to be constrained to single game loop - not sure if this includes pathfinder. Other thing is that I haven't seen game exceed 12-13% cpu usage listed which means it can saturate one core but not more.
Yes due to the way multiplayer and game recording is implemented the simulation needs to be fully deterministic. But this does not mean it needs to be processed in a single thread. It means that no mater when any part of simulation is processed it needs to generate same results given that there are same input parameters.

Now it is possible that devs did some changes in latest versions but I do remember Factorio fully utilizing my CPU.

Post Reply

Return to “Technical Help”