-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Godot 4.4 Beta 1 Takes Long Time To Open/Load Massive Scripts as opposed to Godot 3.6 #101882
Comments
For reference, here is a video of loading this script in 4.3 godot43bug.mp4 |
Profile result: So this is yet another editor performance issue bottlenecked by Some issues that come to my mind immediately:
Haven't tested but I guess switch to |
As a person who does most of my gdscript dev in the editor, these slow downs has been fairly painful in big projects. To the point where I started using an external editor. |
I've also profiled the problem (20s lag spike on load on my end), to see if I can glean anything different. Let's start with the call stack: ![]() Here we can see that each Let's look at the inverted call stack too: ![]() This one is even more fragmented, but there are practical suggestions made by it:
|
I wouldn't have made an issue, as I understand that opening a 100K file is not ideal in any way, but the thing is that Godot 3.6 can load the script almost instantaneously (see above, using 3.6....) Furthermore, there is a drastic speed difference between 4.4 beta 1 and other 4.0 builds. (Try something like 4.0,4.1 and you will see that the loading speed is FAR FAR worse; I assume that the speedup in 4.4 is due to the new editor performance upgrades in 4.4). The script load speed difference/downgrade between Godot 3 and Godot 4 is very interesting; is it truly just a "TextServerAdvanced" thing? |
Correct me if I'm wrong, but I think TextServerFallBack is exactly the text server we use in Godot 3, it lacks the support for some advanced functionalities like BiDi so it is not the default choice but it is really fast :) |
I don't mean to say it's supposed to be slow :) |
Note that TextServerFallback is not compiled in by default, so you need to compile the editor with After compiling it, change the text driver in the project settings to Fallback. This will affect the editor on the current project after restarting. You can also check performance without any text rendering by using the Dummy text driver ( |
CC @bruvzg As pointed out, Godot 4 has more advanced text features than Godot 3, and these features come at a cost. So it's not unexpected that Godot 4 has worth performance on huge texts than Godot 3. That being said, if profiling can identify some low hanging fruits to improve performance of TextServerAdvanced, that would be great. For extremely long files, we could also consider disabling support for some features when detecting such files to avoid too high a performance cost. And show a popup informing the user about it, with the possibility to re-enable them (Kate does this e.g. when loading files with line lengths that exceed a reasonable number). |
For extremely long files we probably should implement threaded loading, there might be parts of |
Tested versions
Reproducible in v4.4.beta1.official,
Not reproducible in v3.6 (notably, #74733 seems relevant)
System information
Godot v4.4.beta1 - Windows 10 - OpenGL 3 (Compatibility)
Issue description
I am currently working with massive scripts (100k+ lines).
For massive scripts, typing and saving works fine in 3.6 and 4.x. However...
In Godot 3, I can load the script in 1-3 seconds.
In Godot 4.4 beta 1, it takes 4x the time to load the scripts (anywhere from 8-15 seconds)
In other Godot 4 builds (4.0, 4.1, 4.2, and 4.3), this problem is worse (it can be 10 - 30 seconds).
G3scriptbug.mp4
G4Scriptbug.mp4
Normally, you shouldn't be using scripts this long. However, Godot 3.6 is able to load massive scripts very fast, whereas Godot 4.4 beta 1 is not able to, so this is where my concern is.
#74733 seems particularly relevant; was there ever a 4.x counterpart? (it seems to deal more with actual typing than loading, but maybe relevant?)
Steps to reproduce
Minimal reproduction project (MRP)
Godot36ScriptLoad.zip
godot43beta1scriptload.zip
The text was updated successfully, but these errors were encountered: