-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
After C# build, the editor freezes longer and longer as the project size scales up #92081
Comments
The repo for the MPR is empty. Have you forgot to push? Also, what is a "Go"? is it a measurement unit of data? or have you misspelled? I googled it but couldn't find. Did you mean gigabyte or maybe gigabit? |
"The MPR depot is empty. Did you forget to push?" => yes, sorry, I'm working on it. I'm using a graphical git client and it's having a bit of trouble handling the 201251 files in my commit. I think I need to use the CLI "Also, what is a "Go"?" => This is Gigabyte. We say "gigaoctet" in french, I did not translate it properly. I edit that. Thank you ! Edit : It took forever, but the MRP is finally available in the repo |
I can confirm the issue. It started also with Version 4.3 dev 6. Did not have this issue in 4.2.1 and the project size has been the same. |
I have the same problem in my project. After a little profiling it seems like most of the time during the freeze is spent in ResourceLoader::get_resource_type called by FileSystemDock::_get_entry_script_icon. For testing I replaced the call to ResourceLoader::get_resource_type with a simple check of the file extension and the freeze went back to just 3 seconds but I'm not familiar enough with Godot's internals yet to make a proper fix. |
Ok, that's weird. I just checked other versions and I reproduced with : I tested with I used a different computer this time. Which explains the differences in measurements with the table in the original message. But the issue is still there. System info : Godot v4.2.1.stable.mono - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 31.0.15.5186) - 12th Gen Intel(R) Core(TM) i9-12900 (24 Threads). Maybe this is not the same problem as yours ? @MatthiasBae @r-eckert |
I also tested 4.2.1 again and yes.. I do not know if I just not recognized it but suddenly it also freezes |
I think I understood what happened and it is very interesting (I updated the reproduction steps of the main message accordingly). Actually, when the godot loading screen disappears, the project is not really loaded. If you check the FileSystem dock at project startup, it is empty. Your project files only appear after a while (the delay seems correlated to the size of the project). If you build before the project is completely loaded (i.e. the FileSystem dock is still empty), the freeze is not present. But if you wait enough for the project to be fully loaded, you will reproduce. |
I just reproduced with a build from source (v4.3.beta.mono.custom_build [be56cab]). @r-eckert I tried your solution but it did not solve the problem for me. Maybe I misunderstood what you did or maybe I did it wrong. Here is my FileSystemDock::_get_entry_script_icon method after changes :
Is that what you did ? I also tried to do some profiling, but in my case the cost of FileSystemDock::_get_entry_script_icon very low. Here's a screen of the most expensive functions of my profiling session : And here is a .csv export of the full session : I hope it could help Edit : For the sake of precision, I would like to point out that I started the profiling session just before clicking on rebuild, and that I stopped it just after regaining focus. The test project was 12GB-Data and 32-Scripts (11.75s freeze according to the table in the problem description) |
It seems like we are looking at two different problems then. I had trouble getting that huge test project to work consistently so I simply assumed that we had the same problem. I tried to profile your test project but with that size it takes forever to import everything and after each editor restart it takes a quite while to load. Maybe a more minimal test project would help get more people on board to test this, though I do understand that the size is an important factor in the problem itself. Sorry for hijacking your issue with an unrelated one. |
Yes, I understand this is not easy to handle. I had a very hard time investigating on it in the first place, and even after figuring out how to reproduce on a separate project, gathering accurate information to create the issue was a nightmare. I tried to guess the minimal size so that somebody with a really powerful CPU can still reproduce. But you are right, maybe it's not the best strategy, I'll try to find something more manageable. That said, 32GB is relatively small in comparison to the average production I had the opportunity to work on. Our projects are more about 100-200GB and we are just a small indie studio. In my opinion, the fact a 32GB project puts Godot on his knees after each editor restart is a problem too. Unlike this freeze thing, I can live with a long startup time so I did not make an issue for that. But I think I should. The underlying causes may be related, and since this is not a C# only problem, it could get more people involved. Thank you for trying to profile the MRP and don't be sorry. It was a promising lead you shared. :) |
In order to ease the testing process, I added multiple branches to the MRP repo corresponding to different amount of data / number of scripts. The It still reproduces the freeze even with a good CPU ( Edit : Some metrics with the new MRP :
|
I made the test 3 times, with this config :
For the first test: For the second test: For the third test (done this evening): Edit: I forgot to mention this but opening and closing the project is terrible for my computer (maybe over an hour to fully open it and still force closed when exiting godot. |
Ok, I was wrong from the very start. The weight of the project has nothing to do with the freeze time. Only the number of files seems relevant. For the sake of clarity, I close this issue and open another one more accurate (and more simple) : #92485 Sorry for the misleading information (and the time you spent with this unmanageable MRP I made you to test). |
Tested versions
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.:
Build
from the toolbar after source changesPlay
from the toolbar after source changesRebuild Project
from theMSBuild 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 :
MSBuild dock
Building .NET project...
popup to disappear to start the stopwatch(Not Responding)
Doing so, I got the following results :
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
1 - clone, download or recreate by hand the MRP (https://github.com/J-Ponzo/editor-freeze-study)
2 - open it with a .NET version of godot (double-click the godot exe then import the project https://docs.godotengine.org/en/stable/tutorials/editor/project_manager.html#opening-and-importing-projects)
3 - wait until the project is completely loaded. i.e. the FileSystem dock should contain something. (This may take a while)
4 - create the C# solution (
Project
=>Tools
=>C#
=>Create C# solution
)5 - rebuild the C# project form the MSBuild dock
6 - spam-click the editor until it freezes
Minimal reproduction project (MRP)
The project is too big but it is available here : https://github.com/J-Ponzo/editor-freeze-study
The text was updated successfully, but these errors were encountered: