Skip to content

After C# build, the editor freezes longer and longer as the project size scales up #92081

Description

@J-Ponzo

Tested versions

  • Reproductible in :
    • v4.3.dev6.mono.official [89850d5]
    • v4.1.2.stable.mono.official [399c9dc]
    • v4.2.stable.mono.official [46dc277]
    • v4.2.1.stable.mono.official [b09f793]
    • v4.3.beta.mono.custom_build [be56cab]

System information

Godot v4.3.dev6.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2080 (NVIDIA; 31.0.15.3623) - Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (8 Threads)

Issue description

If the project is big enough, the editor freezes every time you re-build C#, i.e.:

  • Click Build from the toolbar after source changes
  • Click Play from the toolbar after source changes
  • Launch in debug mode from VisualStudio
  • Click Rebuild Project from the MSBuild dock

The bigger the project is (in data size and scripts number), the longer the freeze lasts.

I tried to make a minimal reproduction project in order to investigate and I came with the following :

  • create an empty project
  • create 32 empty scripts in the project
  • create 32 folders containing ~1GB of data each (to be specific, I used enough copies of those free textures to build my 1GB folder https://opengameart.org/content/700-noise-textures, but it should work with anything I guess)
  • foreach nbScrips/dataAmount combinations, rebuild the project and measure the freeze time :
    • click Rebuild Project from the MSBuild dock
    • wait for the Building .NET project... popup to disappear to start the stopwatch
    • spam-click the editor until the window turns white and be marked (Not Responding)
    • get ready to stop the stopwatch as soon as the editor stops freezing

Doing so, I got the following results :

Freeze time (s) 4GB 8GB 12GB 16GB 20GB 24GB 28GB 32GB
4 Scripts - - - - - - - -
8 Script - - - - - 6.18 7.68 7.74
12 Scripts - - - 6.37 7.35 9.02 11.33 12.36
16 Scripts - - 6.25 8.68 9.82 12.18 15.05 16.60
20 Scripts - - 7.41 10.82 12.16 15.16 19.19 20.27
24 Scripts - 6.24 8.83 12.71 14.6 18.09 22.26 24.37
28 Scripts - 7.53 10.29 14.79 17.3 21.12 26.33 28.61
32 Scripts - 8.30 11.75 16.84 21.21 24.22 29.41 31.96

The empty cells mean the freeze was too short to be properly measured (the editor unfreezes before the window turns white)

Obviously I cannot attach a 32GB minimal project to the issue, and recreating it by hand is really tedious. So I made a public git repository for convenience (see MRP section).

Edit : The MRP is no longer 32GB. I managed to reproduce with a < 5GB project. For convenience, the main branch of the repo points to this lite version.

I know this kind of thing can be really tricky to solve. I stay available for any additional information, testing or anything I can do to help with this. I really hope we can find something because with my actual project, it costs almost 4 minutes every time I click play so I can't really keep on developing it.

Steps to reproduce

Minimal reproduction project (MRP)

The project is too big but it is available here : https://github.com/J-Ponzo/editor-freeze-study

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions