[boskid][1.1.101] Save Loading time regressed to 3 minutes

Bugs that are actually features.
Post Reply
Sym_
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Jan 10, 2024 6:37 pm
Contact:

[boskid][1.1.101] Save Loading time regressed to 3 minutes

Post by Sym_ »

Loading my current save file takes surprisingly long after upgrading. The progress bar appears to complete in a few seconds, then appears stuck long enough that at first i closed the game and tried again.

* Save file (86 MiB): [removed]
* Log file of a 3 minutes load: [removed]

Other configurations I’ve tried:

* Downgrade to 1.1.100 (but keep the same mods enabled): 13 seconds 👍
* Disable all mods (back in 1.1.101): 25 seconds
* Disable all mods except Editor Extensions: 3 minutes. This world contains a few hundred "infinity loader" entities from this mod, but no other modded entity.
* Re-enable mods, enable caching as suggested on Discord (cache-prototype-data on, cache-sprite-atlas on, cache-sprite-atlas-count 5), load (3 min), save with a different name, load that: 13 seconds 👍

https://cdn.discordapp.com/attachments/ ... ddd5b4df64&
Last edited by Sym_ on Thu Jan 11, 2024 5:08 pm, edited 1 time in total.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][1.1.101] Save Loading time regressed to 3 minutes

Post by boskid »

I am going to claim that this is Not a bug because of how this bug report is stated. It is not caused by 1.1.101 release specific. This is caused by internal structures being rebuilt which is triggered by version change but would be also triggered by any mod changes making it not a "regression" but just a slow case due to mod composition.

In your save file there is 1.4 million solar panels and 1.2 millions accumulators, each of those is one ElectricEnergySource, game can handle this without any problems, however by having Editor extensions which adds a "Super electric pole" with a wire range of 64, every ElectricEnergySource when checking if there are electric poles nearby has to search entities in area of 128 by 128 tiles. Usually when saving and loading you will get fast cycle however when save file is loaded in prototypes changed mode, connections between entities and electric poles have to be rebuilt from scratch because pole ranges could change or entities collision boxes could change. This causes each of the 2.5million+ entities during setup to perform an entity search in area of 128x128 and given you have a densly built area with solar panels and accumulators, during those searches there is a lot of entities found that have to be checked if they are electric poles. If there would not be 2.5 million entities, loading would be fast. If there would be no EditorExtensions mod, loading would be relatively fast. Since you are using infinity loaders from this mod i assume you just want to play creative, in which case you can use literally a single "Infinity Accumulator" from editor extensions and just remove all of the electric poles, solar panels and accumulators on the perimeter to reduce amount of entities in your save file.

I may use this save file to do some experiments trying to optimize this use case.

Sym_
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Jan 10, 2024 6:37 pm
Contact:

Re: [boskid][1.1.101] Save Loading time regressed to 3 minutes

Post by Sym_ »

Thank you for the explanation and quick response!

It looks like the cache thing was a red herring: if I revert to default settings a repeat the load-save-load-again dance I’m back to 13 seconds loading time on 1.1.101 with mods enabled. So there is no regression: what takes minutes is only the version migration which is not unreasonable for a save this size. I’m ok with marking this as not a bug. (It’s impressive the game performs this well outside of this migration!)

Indeed I’m playing in "creative" editor mode. I started out with an infinity accumulator together with the infinity loaders. Now that I’m satisfied with the design I’m replacing them with vanilla solar panels and miners as they could have been. (Lakes and ore patches are "conveniently placed" with the editor. Imagining how this would work on a normal map is left as an exercise to the reader.)

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][1.1.101] Save Loading time regressed to 3 minutes

Post by boskid »

I had some ideas how to improve this, they were really successful but given they were only improving migration case (in a noticable way) while being a runtime cost and extra complexity to manage, i decided to reject the optimization idea around this. It is simply a one time cost when migrating save file and i am considering this to be a Not a bug (moving out of Assigned)

Post Reply

Return to “Not a bug”