X Tutup
Skip to content

Improve performance of CSharpLanguage::reload_assemblies#106299

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
Ryan-000:improve-CSharpLanguage-reload_assemblies-performance
Oct 30, 2025
Merged

Improve performance of CSharpLanguage::reload_assemblies#106299
Repiteo merged 1 commit intogodotengine:masterfrom
Ryan-000:improve-CSharpLanguage-reload_assemblies-performance

Conversation

@Ryan-000
Copy link
Contributor

Before each individual CSharpScript would call EditorFileSystem::update_file during assembly reload, which would cause performance problems and a freeze (especially with a large amount scripts) due to EditorFileSystem::_update_script_classes() being called for each file.

This PR batches the updates resolving the issue.

@Ryan-000 Ryan-000 requested a review from a team as a code owner May 12, 2025 07:04
@Chaosus Chaosus added this to the 4.5 milestone May 12, 2025
@akien-mga akien-mga changed the title Improve performance of CSharpLanguage::reload_assemblies Improve performance of CSharpLanguage::reload_assemblies May 12, 2025
Copy link
Member

@raulsntos raulsntos left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. I think it's a great idea to try and batch these updates if we can.

I'm a bit concerned with moving the EditorFileSystem::update_file call from CSharpScript::reload, since there are many other places where this method is called besides CSharpLanguage::reload_assemblies, and we may want to make sure the EditorFileSystem is still updated in those cases.

Maybe there's a way to queue these updates so they don't happen immediately, and instead the update happens once in the next frame (not sure if that may be too late).

@Ryan-000 Ryan-000 force-pushed the improve-CSharpLanguage-reload_assemblies-performance branch from 5031343 to ba3106b Compare May 13, 2025 03:19
@Ryan-000 Ryan-000 requested a review from raulsntos May 13, 2025 03:20
@Ryan-000 Ryan-000 force-pushed the improve-CSharpLanguage-reload_assemblies-performance branch from ba3106b to 71708f8 Compare May 13, 2025 03:22
@Repiteo Repiteo modified the milestones: 4.5, 4.x Jun 16, 2025
@raulsntos raulsntos modified the milestones: 4.x, 4.6 Jun 23, 2025
@Ryan-000 Ryan-000 force-pushed the improve-CSharpLanguage-reload_assemblies-performance branch from 71708f8 to 213e68a Compare June 26, 2025 01:04
Copy link
Member

@raulsntos raulsntos left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me.

@akien-mga akien-mga force-pushed the improve-CSharpLanguage-reload_assemblies-performance branch from 213e68a to f68bf2f Compare October 30, 2025 10:40
@Repiteo Repiteo merged commit 8ab9071 into godotengine:master Oct 30, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 30, 2025

Thanks!

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.

4 participants

X Tutup