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

Performance Tuning #65

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

AndreasBackx
Copy link
Member

@AndreasBackx AndreasBackx commented Oct 6, 2023

I was working on the freezing functionality and along the way I'll use this PR to include some performance improvements.

1. Unneeded resized

image_util::rotate_image_buffer did 1-2 unneeded resizes. Remove the first one if the transform is a normal (or default) and remove the second if the requested size is the same as the original size.

Flamegraph before

image

Flamegraph after

image

I noticed a run in release mode going from ~0.24s to ~0.13s. I could use hyperfine for a better comparison, but I think the flamegraph speaks for itself.

@AndreasBackx AndreasBackx marked this pull request as ready for review October 6, 2023 00:51
@Shinyzenith Shinyzenith merged commit 8dbabab into waycrate:main Oct 6, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants