Windows: File-cache NL/Lix/... for faster level loading

Started by Simon, Today at 01:21:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Simon

NL, Lix, RetroLemmini, ... all contain loose level files and loose image files for tiles. When you load a level for the first time, Windows takes ages to load the files from disk, even on a fast SSD.

To speed it up, make Windows cache the files:

  • In a Windows file browser, navigate to your NL/Lix/... folder.
  • Navigate into the tileset subfolder:
        for Lix, navigate into images
        for NeoLemmix, navigate into styles
  • Shift + Rightclick into the folder.
  • Select: Open PowerShell here.
  • Copy and paste the following command into the shell:
    Measure-Command { Get-Childitem -path . -recurse | Get-FileHash -Algorithm MD5 | Out-Default }
  • Hit Enter.
  • Wait until it has printed how long it has taken. (It might take 5 to 20 minutes or longer.)
  • You can now close the Powershell or leave it open, your choice.
  • Run the game.

Levels should now load significantly faster.

This can be handy before you begin a long uninterrupted play session, e.g., before a livestream. You want the game to load the levels fast, and you don't care if it takes several minutes of preparation.

Technically, this only makes Windows look at each of your files and do something nontrivial with it (compute its checksum). This typically makes Windows cache your file. But it's not a direct request that Windows keep it cached at all times. Windows forgets about the cached files after a reboot, or after you've worked with many other files than NL/Lix/... for a long time. You'll have to re-cache the files by following the instructions again.

Source:
https://stackoverflow.com/a/77295307
https://stackoverflow.com/questions/19825862/is-there-a-way-to-force-windows-to-cache-a-file

-- Simon

WillLem

Could this be built into the program itself? i.e. When closing, cache everything (as a background process) so that the next time it opens it's much quicker? How expensive/ethical would this be?