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

Load project metadata file only when needed #79785

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Jul 22, 2023

Every single time when get_project_metadata() or set_project_metadata() is used, the ConfigFile will be loaded again. These functions are used quite a lot in the editor, so it causes many wasteful I/O operations.

This PR ensures that the file is loaded only when needed, i.e. once at launch and in case of external modification (this is sometimes needed for testing).

@KoBeWi
Copy link
Member Author

KoBeWi commented Jul 23, 2023

Ok I removed the modified time checks. Now the metadata is loaded only once, so you can't modify it externally while the editor is running.

@YuriSizov YuriSizov modified the milestones: 4.2, 4.3 Nov 9, 2023
@YuriSizov YuriSizov added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Nov 9, 2023
Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

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

This will cache the file, so any changes to it will require an editor restart. But this should be fine. Let's just wait for 4.3 just in case, and probably cherry-pick it afterwards.

@KoBeWi
Copy link
Member Author

KoBeWi commented Nov 9, 2023

This will cache the file, so any changes to it will require an editor restart.

Only external changes and this file is not edited externally, because it's in a folder that's usually ignored.

@YuriSizov YuriSizov merged commit 92e024a into godotengine:master Dec 19, 2023
13 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

@KoBeWi KoBeWi deleted the ioioioio branch December 19, 2023 12:41
@YuriSizov YuriSizov removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Jan 25, 2024
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.2.2.

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

Successfully merging this pull request may close these issues.

3 participants