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

Optimize SceneTreeEditor::_update_node_tooltip() #97777

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

YYF233333
Copy link

split to 2 commit to make review easier.

Make SceneTreeEditor::_update_node_tooltip() reuse the string build buffer instead of alloc buffer/tmp string everytime.

1st commit: make StringBuilder suitable for multi time use by reusing the buffer in as_string() method.

2nd commit: use a static StringBuilder for string concat.

performance:

bench with ManyNodes.zip, test time to open ManyNodes.tscn (100k nodes).

Master branch: (about 9.5s)

master

This PR: (about 9.0s)

pr

This PR without changes applied to StringBuilder: (about 9.5s)

sb

@YYF233333
Copy link
Author

restore the original as_string() method, something in the mono interface depends on const attribute.

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.

2 participants