Skip to content

Load project metadata file only when needed - #79785

Merged
YuriSizov merged 1 commit into
godotengine:masterfrom
KoBeWi:ioioioio
Dec 19, 2023
Merged

Load project metadata file only when needed#79785
YuriSizov merged 1 commit into
godotengine:masterfrom
KoBeWi:ioioioio

Conversation

@KoBeWi

@KoBeWi KoBeWi commented Jul 22, 2023

Copy link
Copy Markdown
Member

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).

Comment thread editor/editor_settings.cpp Outdated
@KoBeWi

KoBeWi commented Jul 23, 2023

Copy link
Copy Markdown
Member Author

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
Comment thread editor/editor_settings.cpp

@YuriSizov YuriSizov left a comment

Copy link
Copy Markdown
Contributor

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

KoBeWi commented Nov 9, 2023

Copy link
Copy Markdown
Member Author

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
@YuriSizov

Copy link
Copy Markdown
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
Copy Markdown
Contributor

Cherry-picked for 4.2.2.

BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
Load project metadata file only when needed
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
Load project metadata file only when needed
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