-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Instancing some objects takes a lot of more time in Godot 4 than in Godot 3.x #48978
Comments
The slow LineEdit/TextEdit instantiation is due to the context menus being created for every node, rather than using a single context menu shared across all nodes (only one may appear at a given time). The new context menus feature a lot more things for TextServer/RTL support and the like, so they are slower to create. This also affects nodes that contain LineEdits such as ColorPicker. |
I’d like to point out that each individual popup menu is still slower, i.e. the new context menu options wouldn’t cause such massive slowdowns in 3.x. It’s just that every node is 3-4 times slower, and complex nodes, like ColorPicker, are slower still because they rely on several nodes themselves. Also, @qarmin, I’m pretty sure these are microseconds, not milliseconds. |
This are milliseconds. |
@qarmin Can you also test on master with |
@qarmin Yeah shader compilation takes a lot of the startup time, but it should be only startup time. This week I am going to work on shader caching, which should reduce startup time massively. |
There were many optimizations merged recently. Do you think you could give a try to this benchmark again on the same hardware? |
Now it looks a better in master branch but still creating e.g. Sprite3D is ~60x slower than in 3.x branch
4.0.dev.custom_build. bb037de Projects Tests with 1000 runs Godot3
Godot4
|
How are things faring now on an optimized build? |
I noticed that unlike in Line 288 in bf0253b
While this would resolve #23732, I'd suggest setting it back to 0 by default to avoid this performance regression. |
Godot version:
3.4.beta.custom_build. ea0ccf6
4.0.dev.custom_build. 846b385
OS/device including version:
Ubuntu 21.04 Nvidia 970 465 drivers
Issue description:
When I instanced 1000 objects(without adding them to tree), then I saw that instancing some of classes takes even 200 times more time in Godot 4.0 than in Godot 3.x.
40 the slowest classes in Godot 3.x (1000 runs)
40 the slowest classes in Godot 4.0 (1000 runs)
Minimal reproduction project:
Projects are almost same, but differs in using of Callable and String -> int conversion
Godot 4.0 - SlowClasses4.zip
Godot 3.x - SlowClasses3.zip
The text was updated successfully, but these errors were encountered: