Optimizing Factorio startup performance when running on a hard disk

3 ProcNetWireless 5 8/24/2025, 4:52:29 PM aa55.dev ↗

Comments (5)

throwaway888abc · 2h ago
>Before the optimization, the game took 113 seconds to startup1. After the optimization, the game only took 30 seconds. The script takes 230 seconds to run, much higher than the time taken for the game to load probably because the game only loads parts of the files whereas the script always loads the entire file contents into RAM.

Basically, if you want just play:

Time to play - Your script - 230s + 30s = 260s total

Time to play - Filesystem - 113s = 113s total

For permanent speedup, lets make Factorio fly with ZFS and ARC/L2ARC:

https://www.45drives.com/community/articles/zfs-caching/

ProcNetWireless · 1h ago
I typically power on my PC, attend to other tasks, and by the time I return, the system would have completed the boot process. While the script may take 260s, it runs in the background.
lucb1e · 2h ago
the stated solution is to "load the file contents into RAM at system bootup"

Wait, so you want games on your hard drive because SSD space is too expensive (~55€/TB), so then you permanently occupy some RAM instead (at ~6500€/TB)?

Have you tried doing a linear read from disk instead, like to use zstd for good compression and fast decompression of the Factorio data folder and then make a Factorio shortcut that does like:

    $ cat run-factorio.sh
    mkdir /dev/shm/factorio
    cd /dev/shm/factorio
    tar xf ~/games/factorio.tar.zstd
    /dev/shm/factorio/bin/x64/factorio
    # the above line will block so long as the game runs
    tar c . | zstd -T0 -19 > ~/games/factorio.tar.zstd
    echo Finished saving Factorio data back to disk
such that all reads on startup (and beyond) will be from RAM but only while you are actually running the game?
ProcNetWireless · 1h ago
> Wait, so you want games on your hard drive because SSD space is too expensive (~55€/TB),

I have 3 SSDs and a hard disk. The SSDs are mostly full and I've run out of SATA ports.

>so then you permanently occupy some RAM instead (at ~6500€/TB)?

Its not permanent, the files would be stored in cache which would be cleared if its needed elsewhere.

lucb1e · 4m ago
> the files would be stored in cache which would be cleared if its needed elsewhere.

Right, but then it also loses the benefit so afaict the intention is for it to be there when you start the game