Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emu: Cache games.yml and only save when necessary #13716

Merged
merged 1 commit into from Apr 21, 2023

Conversation

Megamouse
Copy link
Contributor

@Megamouse Megamouse commented Apr 21, 2023

  • Only load games.yml once during lifetime of rpcs3.
  • Only save games.yml once after adding games

This means that if you had 200 games in your /games folder, you will now have at least 200 reads less during startup than before.
The reduction in write during startup won't be as amazing, since we only saved the games.yml when an entry was added (at least with the commit prior to this one).

@Megamouse Megamouse added the Loader Involving the load of PS3 file formats label Apr 21, 2023
@Megamouse Megamouse force-pushed the games_yml branch 3 times, most recently from 8439c9e to b486cc9 Compare April 21, 2023 13:48
@@ -3177,12 +3132,16 @@ void Emulator::AddGamesFromDir(const std::string& path)

if (const auto error = BootGame(dir_path, "", false, true); error == game_boot_result::no_errors)
{
if (std::exchange(m_games_yml_invalidated, false))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not log it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already logged in load

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, i would have to clear the dirty flag each time which only complicates things for no reason

@Megamouse Megamouse merged commit 2c71d08 into RPCS3:master Apr 21, 2023
5 checks passed
@Megamouse Megamouse deleted the games_yml branch April 21, 2023 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Loader Involving the load of PS3 file formats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants