Factorio

Factorio

View Stats:
Saiph Jun 8, 2021 @ 2:43am
Why does my first startup of the day take SO long?
I play Factorio regularly, and I'm always a bit frustrated that my first game startup of the day takes a lot longer than subsequent restarts.

The game seems to spend a long time on the "Checking sprites" task. I'm aware that prototypes, sprites, and some other things are cached to allow faster startups, but WHY is this cache invalidated every day so that the initial startup takes longer?

I'm not changing my mods each day. I'm working on the same map every day at the moment, as I'm building quite a large base (following a series of videos by Nilaus). So why is my data cache being invalidated so often?
< >
Showing 1-7 of 7 comments
Because it is stored in RAM not on the hard drive, as a result it gets wiped on power loss or if too many things are loaded in between.

There is a cache on the drive, but you still need to load that into memory and that can and often will take time.
Saiph Jun 8, 2021 @ 8:29am 
Wrong. You're thinking of the disk cache for the HD or SSD. That's not what I'm talking about.
ShutEye_DK Jun 8, 2021 @ 9:38am 
Originally posted by Saiph:
Wrong. You're thinking of the disk cache for the HD or SSD. That's not what I'm talking about.
44 seconds after reboot (not "every day") and 14 seconds after that on my PC.
How long does it take for your PC?

Windows keeps a "standby" memory pool for recently (after reboot) run apps.
It is indeed a cache stored in RAM.
You can observe the size of this cache by starting Resource Monitor and clicking the "Memory"-tab.
RiO Jun 8, 2021 @ 1:00pm 
Originally posted by Saiph:
Wrong. You're thinking of the disk cache for the HD or SSD. That's not what I'm talking about.

Windows keeps a cache of recently accessed files in memory.
If you open task manager and look at the Memory section of the Performance tab, you'll note that there's a Cached entry there. That's the metric for how much recently accessed data from the file system is still in cache for quick re-use.

If you're inclined to test this out: Microsoft offers a download to an admininstrator/power-user tool called RAMMap that can be used for finer grained insight and which you can use to force purge the RAM cache.

Start Factorio once: it's slow.
Start Factorio again: it's faster.
Use RAMMap to purge the cache.
Start Factorio yet again: it should be slow again.


Alternatively; if all you do is play Factorio, and you never tap into too much of your system memory to endanger the RAM cache (because that will be evicted if the memory is needed elsewhere!) -- then just ensure the Fast Resume functionality in Windows 10 is enabled.

When Fast Resume is enabled, when you shut down your system it doesn't actually go into a full shutdown. It enters a mode of very, very deep hibernation instead. As with any form of deep hibernation, it still persists the RAM state by dumping it out to disk and restoring it on reload. I.e. it literally takes a RAM snapshot. (That's what most of the 'shutting down' and 'starting' time amounts to, actually, if you're not on an SSD: writing and reading that snapshot.) Because it takes a RAM snapshot, it also persists the RAM cache for recently used files.
Last edited by RiO; Jun 8, 2021 @ 1:06pm
Saiph Jun 8, 2021 @ 2:07pm 
I found out the cause. I have Earendel's "Space Exploration" mod in my collection, but NOT active for the save I'm playing. However, due to a Factorio bug, when a mod is updated, the game loads dependency files into your save game EVEN WHEN THE MOD IS NOT ACTIVE.

That is a really stupid bug, and Wube should fix it ASAP.

In my case, my game was loading up all of the Space Exploration hi-res graphics files, even though they were not needed. That's why my load times were so long. I have now deleted the mod and everything seems to be loading much faster now.
RiO Jun 8, 2021 @ 2:45pm 
Originally posted by Saiph:
That is a really stupid bug, and Wube should fix it ASAP.

Yeah, that does sound rather nasty. Personally haven't run into it, but then: I always quit and restart for good measure after a mod updates, so my saves don't get polluted like that. (Too much exposure to Windows, I suppose. :p)

In any case: smells like its worth reporting[forums.factorio.com].

Saiph Jun 8, 2021 @ 3:28pm 
I've just had a look on the bug reports section of the official forum. This problem *has* been reported ("[1.1.19] mod manager installs and activates dependencies of deactivated mod"), but the reply by Rseding91 claimed that it was only a minor thing, and would not be fixed.

I have reminded him of the seriousness of the problem, and how inconvenient it is, so hopefully he might take a little more notice now. Fingers crossed.
Last edited by Saiph; Jun 8, 2021 @ 3:30pm
< >
Showing 1-7 of 7 comments
Per page: 1530 50

Date Posted: Jun 8, 2021 @ 2:43am
Posts: 7