[0.17.23] Performance drop when hovering over roboports in large logistic networks

This subforum contains all the issues which we already resolved.
jarcionek
Fast Inserter
Fast Inserter
Posts: 137
Joined: Thu Mar 10, 2016 11:26 am
Contact:

[0.17.23] Performance drop when hovering over roboports in large logistic networks

Post by jarcionek »

Not strictly a bug, but a performance issue - not sure whether I should have posted it in technical issue. Also, it's just a frame rate drop, nothing blows up, the game is still playable, so it's a rather low priority.

My game normally runs on 60 FPS without any issues.

I built a couple of roboports and logistic storage chests. When hovering over chests, it drops to 53 FPS which is not really noticeable to the eye:


Screenshot 1.png
Screenshot 1.png (7.87 MiB) Viewed 4820 times


But hovering over roboports slows the game down drastically, down to 10 FPS:


Screenshot 2.png
Screenshot 2.png (7.97 MiB) Viewed 4820 times


It is enough to take the cursor away from the roboport and everything comes back to normal.

I am guessing this is due to the fact that chests get highlighted when hovering over roboports, however it highlights them all, even when they are not within the view.
Bilka
Factorio Staff
Factorio Staff
Posts: 3309
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.17.23] Performance drop when hovering over roboports in large logistic networks

Post by Bilka »

Please post a log file of a session with the issue.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
posila
Factorio Staff
Factorio Staff
Posts: 5349
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.17.23] Performance drop when hovering over roboports in large logistic networks

Post by posila »

Thanks for the report.
Can you share the save please? Or at least be specific on how many roboports and logistic chests do you have?
jarcionek
Fast Inserter
Fast Inserter
Posts: 137
Joined: Thu Mar 10, 2016 11:26 am
Contact:

Re: [0.17.23] Performance drop when hovering over roboports in large logistic networks

Post by jarcionek »

Attaching log file, but I don't think there is anything useful in there.

The save file is about 200MB, can I post it on the forum or would you like me to put it in my google drive and share it?

There is over half million chests here and over 10 thousands roboports, however the issue becomes visible with 10% of that.
Attachments
factorio-current.log
(32.09 KiB) Downloaded 130 times
jarcionek
Fast Inserter
Fast Inserter
Posts: 137
Joined: Thu Mar 10, 2016 11:26 am
Contact:

Re: [0.17.23] Performance drop when hovering over roboports in large logistic networks

Post by jarcionek »

I lied about the save, 125MB only - https://drive.google.com/file/d/1HcaMz3 ... PfJ329spOZ

PS all mods I have are non-intrusive so you can easily load the save without any of them.
posila
Factorio Staff
Factorio Staff
Posts: 5349
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.17.23] Performance drop when hovering over roboports in large logistic networks

Post by posila »

I see. I guess that's not gonna be 15 minute fix of some stupid mistake.
Thanks for sharing the save.
jarcionek
Fast Inserter
Fast Inserter
Posts: 137
Joined: Thu Mar 10, 2016 11:26 am
Contact:

Re: [0.17.23] Performance drop when hovering over roboports in large logistic networks

Post by jarcionek »

Could be as simple as only picking the chests within current view area (considering position + zoom). But then, I haven't seen your codebase, so it might only sound simple :)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14269
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.23] Performance drop when hovering over roboports in large logistic networks

Post by Rseding91 »

posila wrote: Mon Apr 01, 2019 7:41 pm I see. I guess that's not gonna be 15 minute fix of some stupid mistake.
It was :P It's now fixed for the next version of 0.17.
If you want to get ahold of me I'm almost always on Discord.
posila
Factorio Staff
Factorio Staff
Posts: 5349
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.17.23] Performance drop when hovering over roboports in large logistic networks

Post by posila »

Rseding91 wrote: Mon Apr 01, 2019 9:16 pmIt was :P It's now fixed for the next version of 0.17.
Yeah, I noticed too :)
But the drop to 53 FPS is probably also fixed/optimized for next release.
jarcionek
Fast Inserter
Fast Inserter
Posts: 137
Joined: Thu Mar 10, 2016 11:26 am
Contact:

Re: [0.17.23] Performance drop when hovering over roboports in large logistic networks

Post by jarcionek »

Nice! Thanks, guys :)
jarcionek
Fast Inserter
Fast Inserter
Posts: 137
Joined: Thu Mar 10, 2016 11:26 am
Contact:

Re: [0.17.23] Performance drop when hovering over roboports in large logistic networks

Post by jarcionek »

Wow, that's amazing now. The FPS doesn't drop by even a bit!

As a developer, I am curious what the issue was? Are you able to share some technical details?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14269
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.23] Performance drop when hovering over roboports in large logistic networks

Post by Rseding91 »

jarcionek wrote: Wed Apr 03, 2019 7:35 am Wow, that's amazing now. The FPS doesn't drop by even a bit!

As a developer, I am curious what the issue was? Are you able to share some technical details?
The hover-over-chest issue was a debug tooltip value which was being created, and then thrown out when the option wasn't enabled. Normally that's fine since at most it runs once per tick for the local player. However, it was doing an O(N) operation to count the number of different logistic chests in that network.

The hover-over-roboport issue was an O(N) operation on roboport coverage areas to see which ones intersect with the screen and it was just optimized so it didn't need to touch as much memory.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”