Performance optimization - post your saves

Post all other topics which do not belong to any other category.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14347
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Performance optimization - post your saves

Post by Rseding91 »

I'm looking for save files where people are experiencing specific (or extreme) performance issues so I can work on optimizing them.

A few examples of existing specific/extreme saves I've profiled and found areas to optimize:
  • During heavy combat with 120 + robots (particle slowdown)
  • Having 5000+ beacons active at once (tick slowdown)
  • Having 66,000+ robots on screen at the same time (Render slowdown)
  • Opening a chest with 5000 slots (GUI slowdown)
  • Having 50,000 + logistic containers and trying to render the logistic selection for all of them (Render slowdown)
Pushing the game well beyond what it can handle helps to show areas that can easily be improved but don't normally stick out due to how in-frequent they're used in a normal game.

If you're going to post a modded save please include the mods. The mods and save also need to run on the latest 0.15.
If you want to get ahold of me I'm almost always on Discord.
User avatar
oLaudix
Filter Inserter
Filter Inserter
Posts: 285
Joined: Sun Jun 14, 2015 3:24 pm
Contact:

Re: Performance optimization - post your saves

Post by oLaudix »

My first time sharing smth via dropbox so im not sure i did it right:
https://www.dropbox.com/s/mrdlfxtf9o3mt ... s.zip?dl=0 - mods
https://www.dropbox.com/s/5novyd5setfui ... 9.zip?dl=0 - save
Screen:
http://i.imgur.com/BUvJzRy.png

Its and old save but all mods should be updated and working.
Image
bobucles
Smart Inserter
Smart Inserter
Posts: 1708
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Performance optimization - post your saves

Post by bobucles »

FYI, a beacon durning brownout will only output a fraction of the strength of its modules. This may explain the 5K slowdown, as every beacon is likely updating the status of its surroundings every tick.

You can get some really odd behavior when a beacon starts losing energy. For example when efficiency modules are installed, a loss of beacon power causes nearby structures to lose their efficiency. They consume more power, thus hurting the beacon even more, causing positive feedback and a potential total loss of function. If stuff shuts down the beacon may have power restored and you get a repeating cycle of this. It's cool to watch but I dunno if it really needs that kind of simulation.
driver
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Wed Oct 28, 2015 11:24 am
Contact:

Re: Performance optimization - post your saves

Post by driver »

Something should be done with the trees. Usually there are many of them and if I zoom out, the framerate goes down to 10 Fps. I don't know if this is only related to hardware, because my graphics card is quite poor (radeon Hd 5400 series).
Rseding91
Factorio Staff
Factorio Staff
Posts: 14347
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Performance optimization - post your saves

Post by Rseding91 »

driver wrote:Something should be done with the trees. Usually there are many of them and if I zoom out, the framerate goes down to 10 Fps. I don't know if this is only related to hardware, because my graphics card is quite poor (radeon Hd 5400 series).
If you can make a reproducible save file I can profile it. But as you said - it might just be your hardware. I can still profile to see if there's some obvious place to save performance if that's the only thing going on :) sometimes stuff shows up when *nothing else* is happening but that one thing.
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14347
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Performance optimization - post your saves

Post by Rseding91 »

bobucles wrote:FYI, a beacon durning brownout will only output a fraction of the strength of its modules. This may explain the 5K slowdown, as every beacon is likely updating the status of its surroundings every tick.

You can get some really odd behavior when a beacon starts losing energy. For example when efficiency modules are installed, a loss of beacon power causes nearby structures to lose their efficiency. They consume more power, thus hurting the beacon even more, causing positive feedback and a potential total loss of function. If stuff shuts down the beacon may have power restored and you get a repeating cycle of this. It's cool to watch but I dunno if it really needs that kind of simulation.
This is the type of thing that I was referring to :) Code that almost never runs but has some huge performance hit when it does. If I can get a save file that's having these weird issues I can profile it and see what there is to improve performance wise.
If you want to get ahold of me I'm almost always on Discord.
User avatar
oLaudix
Filter Inserter
Filter Inserter
Posts: 285
Joined: Sun Jun 14, 2015 3:24 pm
Contact:

Re: Performance optimization - post your saves

Post by oLaudix »

Rseding91 wrote:
driver wrote:Something should be done with the trees. Usually there are many of them and if I zoom out, the framerate goes down to 10 Fps. I don't know if this is only related to hardware, because my graphics card is quite poor (radeon Hd 5400 series).
If you can make a reproducible save file I can profile it. But as you said - it might just be your hardware. I can still profile to see if there's some obvious place to save performance if that's the only thing going on :) sometimes stuff shows up when *nothing else* is happening but that one thing.
I dont know how much VRAM his GPU has, but i noticed that the trees eat quite a lot. When i was testing it it was something like 1500MB vs 1700MB of VRAM needed without and with a lot of trees on screen respectively.
Image
Xeteth
Fast Inserter
Fast Inserter
Posts: 158
Joined: Tue Feb 17, 2015 6:06 am
Contact:

Re: Performance optimization - post your saves

Post by Xeteth »

I'm happy to send my save in - I'd rather not have it public at the moment since it's my stream save. Should I send a private message with a DL link to your inbox?
driver
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Wed Oct 28, 2015 11:24 am
Contact:

Re: Performance optimization - post your saves

Post by driver »

Concerning trees - it's mainly a problem of map generation. My first big game was mainly a desert map, which was absolutely fine, but now I often get maps with an insane amount of trees, but it already helps if I set the terrain variation to rich to get less trees.
Perhaps an option to choose a desert map would be fine, because I like to make use of the car.
I could limit the zoom, but if you like to look at your train network, you probably prefer to zoom out at max very often.
nobodx
Fast Inserter
Fast Inserter
Posts: 157
Joined: Mon Jul 06, 2015 3:22 pm
Contact:

Re: Performance optimization - post your saves

Post by nobodx »

Usually my game runs fine, but since the latest .15 update it starts to lag around my power engines.
I'm not on my computer right now sink can't give you a upload.

It might have something to do with the updated steam-graphic, or that I run it with my onboard graphic card with 1 or 2 GB VRAM (not sure, not in my computer right now)
AgentZero
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Apr 27, 2016 3:14 am
Contact:

Re: Performance optimization - post your saves

Post by AgentZero »

Are you still looking for save files?

I'm having some pretty serious performance issues on my system
FX-8320
32GB DDR3
2x nVidia GTX 660ti
- Problem occurs with SLI off, not as noticeable with SLI on however still seems evident.
I feel that I meet recommended requirements.
But, Full CPU-Z system info dump is available by PM on request.

GPU-Z shows extremely high peak Bus Interface Loads that accompany the studdering and shuddering that occurs in game.

Problem occurs when the steam engine boilers run low on fuel.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14347
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Performance optimization - post your saves

Post by Rseding91 »

If you can provide the save file in the state when it's having issues and give steps to reproduce it yes.
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14347
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Performance optimization - post your saves

Post by Rseding91 »

I'm still interested in large save games (modded or not - if modded please also upload the mods) :)
If you want to get ahold of me I'm almost always on Discord.
keyboardhack
Filter Inserter
Filter Inserter
Posts: 478
Joined: Sat Aug 23, 2014 11:43 pm
Contact:

Re: Performance optimization - post your saves

Post by keyboardhack »

I assume it's the mass of bots that primarily slows down the game but i can't be sure. Here is some observation i have done of the performance.
Save and mods are attached below.

Observed problems:
  • FPS loss in the productions tab. Usually halves the fps to open the production tab.
  • FPS loss in the train preview when not set to map mode. The more the train preview camera is zoomed out the worse the fps gets.
  • When placing tracks that connects to the railway the whole game stops for a short moment.
  • Deconstructing or construction anything with a few hundred items will slow the game to 8-10ups.
  • Running this command

    Code: Select all

    /c local surface = game.player.surface; for coord in surface.get_chunks() do surface.pollute({coord.x * 32, coord.y * 32}, -10000000) end
    usually increases the ups by ~5.
SuperSaveS.zip
(110.75 MiB) Downloaded 833 times
SuperSaveS_mods.zip
(9.88 MiB) Downloaded 501 times
Waste of bytes : P
bk5115545
Fast Inserter
Fast Inserter
Posts: 123
Joined: Sun Apr 03, 2016 7:00 pm
Contact:

Re: Performance optimization - post your saves

Post by bk5115545 »

Hey Rsedsing you probably saw it but here's a massive save that has some lag because if the trains.
viewtopic.php?f=49&t=35519

You have to turn on the copper ore and iron ore unloading via the circuit network at the train stations on right and top of the base.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14347
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Performance optimization - post your saves

Post by Rseding91 »

keyboardhack wrote:Observed problems:
  • FPS loss in the productions tab. Usually halves the fps to open the production tab.
  • FPS loss in the train preview when not set to map mode. The more the train preview camera is zoomed out the worse the fps gets.
  • When placing tracks that connects to the railway the whole game stops for a short moment.
  • Deconstructing or construction anything with a few hundred items will slow the game to 8-10ups.
  • Running this command

    Code: Select all

    /c local surface = game.player.surface; for coord in surface.get_chunks() do surface.pollute({coord.x * 32, coord.y * 32}, -10000000) end
    usually increases the ups by ~5.
What graphics card do you have? Most of those sound like your graphics card just isn't powerful enough since they're almost all render related.
If you want to get ahold of me I'm almost always on Discord.
d4rkpl4y3r
Long Handed Inserter
Long Handed Inserter
Posts: 66
Joined: Wed Apr 27, 2016 8:24 pm
Contact:

Re: Performance optimization - post your saves

Post by d4rkpl4y3r »

FPS loss in the productions tab. Usually halves the fps to open the production tab.
I experience this as well, render time in my base is usually around 4 ms and when I open up the production screen it goes up to 25ms. Definitifely not a hardware issue since I just got a GTX 1070.
FunMaker
Fast Inserter
Fast Inserter
Posts: 107
Joined: Wed Jun 08, 2016 8:43 pm
Contact:

Re: Performance optimization - post your saves

Post by FunMaker »

Attached a game with some bases connected to each other by train. Most bases are unloaded/loaded by Robots - 0.14.20.

my Spec:

i7-920
GTX 970 (4GB)
24 GB RAM.

FPS/UPS mostly linked to each other at 25-30 FPS/UPS. It does not matter if i am near a base with many robots or not - performance stays mostly the same.

Just run up in the game to see my smelters (10k+ Bots). To increase performance i was thinking about changing to belts - but 50-80 belts next to each other is not my cup of the and possibly it would make the performance even worse...

Main Problem: 1 core at 90%, 1 core at 20%, 6 cores at 10%. Seems that robots are not multithreaded and i think they are a great point to handle them concurrently.
Another approach that might be not a good idea:
Simulate robots as a whole:
Count of robots = c
delay for pickup from provider chest: x / c
delay for dropoff at provider chest: y / c
so the complete movement of robots would be eliminated. I know this might remove the feeling of "when does that dumb robot arrive?". But would increase performance alot.

Hopefully you are already at that point of optimization that robots are handled alot better in your dev version ;)
Attachments
Performance Prob.zip
(49.98 MiB) Downloaded 649 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14347
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Performance optimization - post your saves

Post by Rseding91 »

d4rkpl4y3r wrote:
FPS loss in the productions tab. Usually halves the fps to open the production tab.
I experience this as well, render time in my base is usually around 4 ms and when I open up the production screen it goes up to 25ms. Definitifely not a hardware issue since I just got a GTX 1070.
When I open the production window on the provided save it lowers the FPS by 4.

What graphics settings are you using?
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14347
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Performance optimization - post your saves

Post by Rseding91 »

FunMaker wrote:FPS/UPS mostly linked to each other at 25-30 FPS/UPS. It does not matter if i am near a base with many robots or not - performance stays mostly the same.
It runs at a solid 40 FPS/UPS for me on an i7-4790K with a GTX 970. Currently in 0.15 it runs at 53 FPS/UPS for me.
FunMaker wrote:Main Problem: 1 core at 90%, 1 core at 20%, 6 cores at 10%. Seems that robots are not multithreaded and i think they are a great point to handle them concurrently.
If you think that you know nothing about how Factorio works. The entire simulation is deterministic meaning you can't just update things in random orders on different threads even if that wouldn't cause concurrency issues with the robots as they moved around the map/interacted with data structures that don't support threading.

https://www.reddit.com/r/factorio/comme ... 4/d5mrewu/
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “General discussion”