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

Minor TextPipeline cleanup #17274

Merged
merged 1 commit into from
Jan 10, 2025
Merged

Conversation

rparrett
Copy link
Contributor

Objective

Both set_metrics and set_size can trigger text re-layout and re-shaping, if the values provided are different form what is already in the Buffer.

Solution

Combine the set_metrics and set_size calls.

This might be a small optimization in some situations, maybe when both font size and text bounds change in the same frame, or when spawning new text.

I did measure a ~500 microsecond improvement in text_system for many_buttons --respawn, but that may have just been noise.

@alice-i-cecile alice-i-cecile added C-Performance A change motivated by improving speed, memory usage or compile times C-Code-Quality A section of code that is hard to understand or change A-Text Rendering and layout for characters S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 10, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 10, 2025
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 10, 2025
Merged via the queue into bevyengine:main with commit ec795a2 Jan 10, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Text Rendering and layout for characters C-Code-Quality A section of code that is hard to understand or change C-Performance A change motivated by improving speed, memory usage or compile times S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants