Skip to content

Conversation

@unknownbrackets
Copy link
Collaborator

This way we don't get slow startup. This will also cache the CSO data, for example, rather than the raw data, using up less RAM. It might even be reasonable to enable on 32-bit.

Ought to change the lang to remove "slow startup" if this is merged.

Makes #7951 not really an issue anymore, practically speaking.

Note that the semantics here are:

  • It loads the ISO from start to finish.
  • If the game tries to load farther ahead, it reads this synchronously, and then schedules a bit of readahead for the next few blocks.
  • This still works with all file-loader types (e.g. even HTTP.)

-[Unknown]

This way we don't get slow startup.  This will also cache the CSO data,
for example, rather than the raw data, using up less RAM.  It might even
be reasonable to enable on 32-bit.
Better to fail to preload than to crash.
@unknownbrackets
Copy link
Collaborator Author

Could probably refactor this logic into an HTTP downloader as well, since it would be the same concept.

-[Unknown]

@hrydgard
Copy link
Owner

I guess some people might still want to trade slow startup time for guaranteed no disk-hitches (these synchronous reads could potentially still take a little bit of time) but to me this makes a lot of sense.

@unknownbrackets
Copy link
Collaborator Author

Well, it does background read in chunks, and it only reads in 64k blocks. The hitches should be very minimal. Anyway, all they would have to do is wait the appropriate amount of time (the same time they would've waited before) and then there would be guaranteed no hitches.

-[Unknown]

hrydgard added a commit that referenced this pull request Dec 19, 2015
Use a background thread to load ISO into RAM
@hrydgard hrydgard merged commit 72733ca into hrydgard:master Dec 19, 2015
@hrydgard
Copy link
Owner

Yeah, that's a good point, could just wait the same amount of time on the title screen indeed.

@Jack54guythecoder
Copy link

RIP to this feature, rest in spaghetti, never forgetti.

@hrydgard
Copy link
Owner

Actually, see #20158 . One assumption behind the removal was wrong, it wasn't broken/ineffective on all platforms, just on non-x86 (it broke on x86 fairly recently). So I'll probably revert.

@Unknowncat1991
Copy link

@hrydgard this Cache Full iso in RAM can also help chd file format? or only ISO or CSO only?
sorry for the stupid question 😅

@hrydgard
Copy link
Owner

hrydgard commented Mar 27, 2025

Can in theory help either one, but on most machines you will not see any benefit. Only really useful for machines with slow harddrives that spin down.

Reverting in #20165 , this time with correct platform checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants