Skip to content
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 Scene Tree editor performance #99700

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hpvb
Copy link
Member

@hpvb hpvb commented Nov 26, 2024

We now cache the Node*<>TreeItem* mapping in the SceneTreeEditor. This allows us to make targeted updates to the Tree used to display the scene tree in the editor.

Previously on almost all changes to the scene tree the editor would rebuild the entire widget, causing a large number of deallocations an allocations. We now carefully manipulate the Tree widget in-situ saving a large number of these allocations.

There is definitely more that could be done, but this is already a massive improvement.

This fixes #83460

We now cache the Node*<>TreeItem* mapping in the SceneTreeEditor. This
allows us to make targeted updates to the Tree used to display the scene
tree in the editor.

Previously on almost all changes to the scene tree the editor would
rebuild the entire widget, causing a large number of deallocations an
allocations. We now carefully manipulate the Tree widget in-situ saving
a large number of these allocations.

There is definitely more that could be done, but this is already a
massive improvement.

This fixes godotengine#83460
@hpvb hpvb added topic:editor performance cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Nov 26, 2024
@hpvb hpvb requested review from a team as code owners November 26, 2024 01:39
@hpvb
Copy link
Member Author

hpvb commented Nov 26, 2024

Before: (this scene has about 15,000 nodes)

Screencast.From.2024-11-26.02-11-22.mp4

After:

Screencast.From.2024-11-26.02-10-35.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release performance topic:editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manipulating the scene tree gets progressively slower with more nodes added to the tree in the editor.
1 participant