X Tutup
Skip to content

Speed up deletion via the Scene Tree Dock in large trees#109511

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
precup:speedy-editor-deletions
Oct 27, 2025
Merged

Speed up deletion via the Scene Tree Dock in large trees#109511
Repiteo merged 1 commit intogodotengine:masterfrom
precup:speedy-editor-deletions

Conversation

@precup
Copy link
Contributor

@precup precup commented Aug 11, 2025

If you open Label25k.tscn in the test project below, and then attempt to delete one of the elements by selecting it in the scene tree dock and then pressing delete, it takes ~12 seconds for me without this PR. With this PR, it's less than half a second.

Here's the flamegraph showing the problem:
image

The SceneTreeEditor change take the performance from terrible to usable, getting the time down to under a second by itself.

The Tree Vector -> LocalVector change only makes hundreds of ms worth of difference, but that's enough to bring it from usable to pretty good. It's the less important of the two, if it's objectionable.


All performance tests were run on builds made with the following command: scons optimize=speed_trace debug_symbols=yes platform=linuxbsd dev_build=no production=yes

The test project editor-optimization-test-scenes.zip consists of a series of scenes that each have 25,000 of a common type of node.

@precup precup requested review from a team as code owners August 11, 2025 05:35
@AThousandShips AThousandShips added this to the 4.x milestone Aug 11, 2025
@precup precup force-pushed the speedy-editor-deletions branch from 00c0b3d to e9f3112 Compare August 13, 2025 00:10
@precup precup requested a review from a team August 13, 2025 00:10
@KoBeWi KoBeWi modified the milestones: 4.x, 4.6 Aug 30, 2025
Copy link
Member

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.
This code seems a little overcomplicated for me, but that's not really your fault. It might just be due for a structural refactor some time. But for now, your fixes are needed, so LGTM.

@precup precup force-pushed the speedy-editor-deletions branch from e9f3112 to ddb87f5 Compare October 23, 2025 05:20
@precup precup force-pushed the speedy-editor-deletions branch from ddb87f5 to 1ad3b99 Compare October 23, 2025 05:46
@Repiteo Repiteo merged commit ae8c929 into godotengine:master Oct 27, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 27, 2025

Thanks!

@precup precup deleted the speedy-editor-deletions branch November 9, 2025 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

X Tutup