Skip to content

Improve OrderedFloat hash performance#7512

Merged
emilk merged 2 commits intoemilk:mainfrom
valadaptive:orderedfloat-hash
Sep 8, 2025
Merged

Improve OrderedFloat hash performance#7512
emilk merged 2 commits intoemilk:mainfrom
valadaptive:orderedfloat-hash

Conversation

@valadaptive
Copy link
Contributor

@valadaptive valadaptive commented Sep 8, 2025

  • I have followed the instructions in the PR template

Another thing that showed up in the profiler when working on #7431. I'm doing a lot of caching of fonts by size, which involves hashing a lot of OrderedFloats. We can take a page from the ordered-float crate and save a branch, which speeds things up by a couple percent in the text_layout_uncached benchmark.

@github-actions
Copy link

github-actions bot commented Sep 8, 2025

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

@lucasmerlin lucasmerlin added performance Lower CPU/GPU usage (optimize) emath Relates to the emath crate labels Sep 8, 2025
Copy link
Collaborator

@lucasmerlin lucasmerlin left a comment

Choose a reason for hiding this comment

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

Nice! Makes sense to me

@emilk emilk merged commit a8e36e3 into emilk:main Sep 8, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emath Relates to the emath crate performance Lower CPU/GPU usage (optimize)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants