[Rseding] [2.0.21] 'Show pipelines' in map mode decreases performance

This subforum contains all the issues which we already resolved.
roy-t
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Jan 31, 2020 11:36 am
Contact:

[Rseding] [2.0.21] 'Show pipelines' in map mode decreases performance

Post by roy-t »

Problem
On a reasonable large map on Nauvis the FPS drops significantly when turning on the 'show pipelines' option in map mode when completely zoomed out. We have 23k pipes and 11k underground pipes.

Steps to reproduce
1. Open the attached save game
2. Open the map-view on Nauvis
3. Zoom out until you see the entire discovered area
4. Enable the 'show pipelines' option
5. See that the FPS takes a big hit

Since
We first noticed this after the update to `2.0.21`. Before that we did not have any problems.

Lay man's analysis
In that scenario, looking at the `show-gpu-time-usage` I see that normally the GPU spends on average 1.1ms on `Game render preparation`. But with the 'show pipelines' option on this number jumps to to 7.5ms. I don't see a significant increase in the number of sprites (13590->13600) but I doo see that the 'Calls :G' jumps from 12 to 31.

Attachments
To not just have to rely on own analysis I've added two screenshots that show all the gpu timings with and without the 'show pipeline' options enabled as well as our save game.
Attachments
factorio_pipelines_bug_report.zip
(57.91 MiB) Downloaded 21 times
factorio_without_show_pipelines.png
factorio_without_show_pipelines.png (895.49 KiB) Viewed 448 times
factorio_with_show_pipelines.png
factorio_with_show_pipelines.png (875.53 KiB) Viewed 448 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 15000
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.21] 'Show pipelines' in map mode decreases performance

Post by Rseding91 »

Do you by chance have a pre-2.0.21 save that I can test with to see if there was actually any performance regression with this rendering logic?
If you want to get ahold of me I'm almost always on Discord.
roy-t
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Jan 31, 2020 11:36 am
Contact:

Re: [2.0.21] 'Show pipelines' in map mode decreases performance

Post by roy-t »

Of course, and it could be gut feeling that this only started in 2.0.21. I've attached a save that I think is the most recent pre 2.0.21 save that we have. We were working on our oil but I think the biggest pipelines are already here in this save.
Attachments
factorio_bug_report_pre_2.0.21.zip
(54.15 MiB) Downloaded 15 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 15000
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.21] 'Show pipelines' in map mode decreases performance

Post by Rseding91 »

Thanks. I was able to confirm that there was no regression at least between 2.0.20 and 2.0.21 with this overlay. I did however find some ways to improve the performance for the next release.

In my testing in 2.0.21 having it on it made render-prepare take 4.5 MS/tick and after my improvements it now takes 1.52 MS/tick. With it off, it takes 0.8 MS/tick. So the overall cost for the overlay went from 3.6 MS/tick to 0.72 MS/tick (a 5x improvement).
If you want to get ahold of me I'm almost always on Discord.
roy-t
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Jan 31, 2020 11:36 am
Contact:

Re: [2.0.21] 'Show pipelines' in map mode decreases performance

Post by roy-t »

Ouch looks like our gut-feeling that it happened in 2.0.21 was off. But wow that's a great improvement! Great that you were able to figure this out so fast. Looking forward to the update and ever increasing performance of Factorio!
Post Reply

Return to “Resolved Problems and Bugs”