Skip to content

Conversation

afishhh
Copy link
Contributor

@afishhh afishhh commented Oct 17, 2025

Moves ends_with_newline into PlacedRow to avoid clones during layout.
I don't think there was a rationale stronger than "don't change too much" for not doing this in #5411, so I should've just done this from the start.
This was a significant part of the profile for text layout (as it cloned almost every Row, even though it only needed to change a single boolean).

Before:
image

After:
image

(note that these profiles focus solely on the top-level Galley::layout_inline subtree, also don't compare sample count as the duration of these tests was completely arbitrary)

egui_demo_lib *text_layout* benches:
image

  • I have followed the instructions in the PR template

(As usual, the tests fail for me even on master but the failures on master and with these changes seem the same :))

Copy link

github-actions bot commented Oct 17, 2025

Preview available at https://egui-pr-preview.github.io/pr/7649-dont-clone-rows
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

View snapshot changes at kitdiff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant