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

Long editor freeze after editing script in C# and building it #81309

Open
filipinyo opened this issue Sep 4, 2023 · 6 comments
Open

Long editor freeze after editing script in C# and building it #81309

filipinyo opened this issue Sep 4, 2023 · 6 comments

Comments

@filipinyo
Copy link

filipinyo commented Sep 4, 2023

Godot version

4.1 - 4.1.1 Mono (C#)

System information

Windows 11, Fedora 38 (XFCE, Gnome, KDE) - Godot 4.1 - 4.1.1, Dotnet 7, Ryzen 5950, Geforce 3080, 128gb DDR4 RAM

Issue description

I've experienced this issue all the way from 4.1 to 4.1.1 on windows 11 and on linux fedora 38 (XFCE, Gnome, KDE) - C#. If you change something in a script and click build, the project gets built fast, but the editor becomes unresponsive for 30-60 seconds on Linux and for significantly less time unresponsive on Windows 11.

I've downgraded my project to 4.0.4 and this issue does not exist anymore, I regain the control in 1-2 seconds.

Steps to reproduce

Install and run on Windows 11, Fedora 38.

Minimal reproduction project

/

@filipinyo filipinyo changed the title Long editor freeze after changing script in C# and building it Long editor freeze after editing script in C# and building it Sep 4, 2023
@filipinyo
Copy link
Author

filipinyo commented Sep 8, 2023

I've tested this in new project and this doesn't seem to be the case. In my main project I'm using other packages, could this be a reason for the issue? But still it is very strange because in 4.0.4 the godot editor doesn't freeze at all:

My .csproj file

<Project Sdk="Godot.NET.Sdk/4.1.1"> <PropertyGroup> <TargetFramework>net7.0</TargetFramework> <EnableDynamicLoading>true</EnableDynamicLoading> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.4" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.4" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.4"> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <PrivateAssets>all</PrivateAssets> </PackageReference> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.4" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.2" /> <ProjectReference Include="../db/db.csproj" /> </ItemGroup> </Project>

@filipinyo
Copy link
Author

UPDATE: Removed all the packages, commented out the code, disabled all the plugins, but the problem remains.

@Red-Ward-Studio
Copy link

I've had this same problem for a while, I've noticed the editor freezing gets longer and longer (reaching 2mins 50 secs in some cases), but it goes back to about 20 or so seconds after deleting the .godot folder.

Nonetheless, I timed the editor response time after deleting the .godot folder, cleaning the solution in Visual Studio and then clicking on the build button in Godot on a few different branches and found this:

  • Current: 322 ".cs" files, time 25.68s
  • 9th April: 192 ".cs" files, time 20.68s
  • 11th March: 172 ".cs" files, time 18.12s
  • 1st February: 91 ".cs" files, time 10.23s

I'm not sure if this has anything to do with it, it might be either the .godot folder getting too large or the editor waiting for a rescan of the entire cache before becoming responsive again.

@raulsntos
Copy link
Member

@filipinyo How many C# classes does your project have? Since you mention the issue happens in 4.1 but not in 4.0, it looks like you may be running into #92485. If that's the case, it should be fixed in 4.3 beta 2.

@Red-Ward-Studio It looks like your issue is #92485 and should be fixed in the next beta. If you are using linux you can try the linux-editor-mono artifact. Otherwise, please wait for the 4.3 beta 2 release and check if it's fixed.

@monxa
Copy link

monxa commented Jun 19, 2024

@filipinyo in your projects root, could you try running dotnet build and then dotnet build --no-restore for comparison and observe the build times? Does the latter significantly reduce them?

@raulsntos
Copy link
Member

@monxa That's unlikely to make a difference, OP claims that building is fast it's just that the editor freezes afterwards, probably because of re-scanning the file system. That's why I think it's a duplicate of #92485.

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

No branches or pull requests

5 participants