-
-
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
Improve performance of the 'Create New Node' dialog #86447
Improve performance of the 'Create New Node' dialog #86447
Conversation
17ef028
to
b6154c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally (rebased on top of master
ce00392), it works as expected.
With an optimized editor build, I can't notice too much a difference before and after this PR.
However, with a debug editor build, the difference is much more noticeable. The Create New Node dialog opens significantly faster with this PR and it doesn't freeze for as long when typing.
The difference should be even more noticeable on slower CPUs.
PC specifications
- CPU: Intel Core i9-13900K
- GPU: NVIDIA GeForce RTX 4090
- RAM: 64 GB (2×32 GB DDR5-5800 C30)
- SSD: Solidigm P44 Pro 2 TB
- OS: Linux (Fedora 39)
- Merged 3 for loops into 1 and save Vector allocation - Use get_instance_base_type() or get_global_name() instead of get_language()->get_global_class_name() for performance considerations - Use StringName where appropriate
b6154c2
to
af6a4f3
Compare
Thanks! |
Fixes: #27333
Fixes: #34205
Vector
allocationtype_list
and add the matching types to the treeget_instance_base_type()
orget_global_name()
instead ofget_language()->get_global_class_name()
for performance considerationsStringName
where appropriateNode
,Node2D
,Sprite2D
, ... so usingStringName
makes sense here (and was also in place before, just not consistently)_add_type
This also fixes a bug where scripts/resources with compile errors were displayed in the dialog although they can not be used, resulting in errors (and even a crash) when searching in the dialog (
Broken.gd
is a file with compile errors):Benchmarks:
Dialog with nodes
Tested in Debug Build
Test case: 800+ Global Classes
Dialog with resources
Tested in Debug Build
Test case: 800+ Global Resources
Result
Performance improved between x1.2 and x1.6. Dialog feels more snappy.
Project:
ManyFiles.zip
Note
Similar improvements can be done to other places in the editor as far as I can see.