-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Scene editing is slow in complex projects #60127
Comments
Will you have some time to test it at least in beta1 and beta2? https://downloads.tuxfamily.org/godotengine/3.5/ |
Same issue in beta1. |
The action consists simply of deleting and a node and then clicking on "undo"?. 2022-04-12.11-14-05.mp4However, I did notice that when a script has many features. 2022-04-12.11-18-11.mp4 |
The issue happens on big scenes. Also I think it might be related to instances. When you have tens of instances, the performance is abysmal. But I have a GUI scene with over a hundred of nodes, without any instance, and there is 0 delay (just like in 3.4). |
Probably needs an MRP to bisect / profile (unless a contributor knows they have worked on something that might have been a likely suspect). |
I tried to make an MRP, but obviously (bruh) the issue doesn't in a minimal project. I created a KinematicBody2D scene with a few sprites and an Area2D child, which is similar to what I typically use and no freezes even with a few hundred instances. Maybe it's related to complexity of the project, like number of class names etc. |
You can use a shell script to create a lot of named classes: #27333 (comment) |
Still no luck. I created a bunch of classes, with multiple levels of inheritance, and extended one of them in the scene. Then multiplied the number of instances on my test scene and also made it very deep. After that switching scenes became very slow and the editor started lagging, but duplicating nodes was still instant. So instead I went to my main project and created empty scene with a few instances. The issue appeared with just 10 of them. So I started stripping the instanced scene. It was still causing freezes after removing everything except the root node. So I removed script from the root node and it helped. So then I restored the scene and tinkered with the script. I cleared it completely and removed a few levels of inheritance, leaving just EDIT: |
Bisected to #54614 EDIT: EDIT2: EDIT3: |
Found a potential culprit. This is caused by updating scene tree. The editor has to set icon for every node. In case of scripts, the script is parsed in search of icon. I don't know how it works internally, but seems like each script is parsed every time the editor needs to get the icon and in case of references between scripts, preloads etc, this becomes extremely slow. Here: godot/modules/gdscript/gdscript.cpp Line 2103 in 3a82b7e
I added return ""; after this line and the issue disappears.
We should cache the icons, so they can be easily accessed without parsing the script more than once. |
Everything that is done to optimize that will be good. |
Godot version
3.5 beta3
System information
Windows 10 x64
Issue description
I recently noticed that the scene editing is much less smooth than it used to be. The difference is so noticeable that I was able to record it.
Here's removing and adding a node in 3.4 beta6
Literally instant.
And the same operation in 3.5 beta3:
The 1 second lag after every action is so visible that it hurts.
I didn't test between which versions exactly this started happening.
Also doesn't seem to happen in 4.0 alpha6.
Steps to reproduce
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: