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

Fix freeze after building C# project with a lot of files #92893

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

Hilderin
Copy link
Contributor

@Hilderin Hilderin commented Jun 8, 2024

Fixes #92485

With the MRP project, on Godot 4.2, it took 1 min after rebuild.

With this modification, it now takes less then 1 sec.

I added the method update_files in editor_file_system that can take a list of files in parameter. Instead of calling updates_file from ScriptManagerBridge for each file, I call this new method only once.

I was the first time that I tried to modify the native functions between C++ and C# but I think I figured it out!!

@Hilderin Hilderin requested a review from a team as a code owner June 8, 2024 03:02
@raulsntos raulsntos added this to the 4.3 milestone Jun 8, 2024
@raulsntos raulsntos requested a review from a team June 8, 2024 03:32
@Hilderin Hilderin force-pushed the fix-freeze-after-building-c# branch from 27cd994 to 2f34bbe Compare June 8, 2024 03:32
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 contributing to the .NET module. In general, the change makes sense to me but I'd like to confirm with the Editor team that they are OK with this.

I have also left some comments about the .NET changes.

@Hilderin Hilderin force-pushed the fix-freeze-after-building-c# branch from 2f34bbe to 6d1e5b0 Compare June 8, 2024 03:51
@Hilderin
Copy link
Contributor Author

Hilderin commented Jun 8, 2024

All the changes should be done. Thanks for your comments.

@Hilderin Hilderin force-pushed the fix-freeze-after-building-c# branch from 6d1e5b0 to 893fdd3 Compare June 8, 2024 04:17
editor/editor_file_system.h Outdated Show resolved Hide resolved
editor/editor_file_system.cpp Outdated Show resolved Hide resolved
@Hilderin Hilderin force-pushed the fix-freeze-after-building-c# branch from 893fdd3 to 6fecb8e Compare June 8, 2024 15:05
if (!fs) {
return;
void EditorFileSystem::update_files(const Vector<String> &p_script_paths) {
for (String file : p_script_paths) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
for (String file : p_script_paths) {
for (const String &file : p_script_paths) {

Or is there a specific reason you didn't apply that part? This saves copying and the values aren't (and shouldn't) be modified

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad! done!

@Hilderin Hilderin force-pushed the fix-freeze-after-building-c# branch from 6fecb8e to 7cc973b Compare June 8, 2024 15:12
@Hilderin Hilderin force-pushed the fix-freeze-after-building-c# branch from 7cc973b to 47b4acf Compare June 8, 2024 22:26
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.

Works as expected and the changes to the mono module look good to me.

@Hilderin Hilderin force-pushed the fix-freeze-after-building-c# branch from 47b4acf to cc990ef Compare June 9, 2024 17:41
@akien-mga akien-mga requested a review from KoBeWi June 10, 2024 11:29
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

Editor changes look ok.

@akien-mga akien-mga merged commit e4fd5b5 into godotengine:master Jun 10, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Hilderin added a commit to Hilderin/godot that referenced this pull request Jun 11, 2024
akien-mga added a commit that referenced this pull request Jun 11, 2024
@akien-mga akien-mga changed the title Fix freeze after building C# Fix freeze after building C# project with a lot of files Jun 20, 2024
MewPurPur pushed a commit to MewPurPur/godot that referenced this pull request Jul 11, 2024
sorascode pushed a commit to sorascode/godot-soras-version that referenced this pull request Jul 22, 2024
2nafish117 pushed a commit to 2nafish117/godot that referenced this pull request Aug 5, 2024
chryan pushed a commit to chryan/godot that referenced this pull request Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants