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

Improve byte buffer iteration speed by 90% #664

Closed
wants to merge 1 commit into from

Conversation

ejensen
Copy link
Contributor

@ejensen ejensen commented Oct 22, 2022

Overview

Improves the speed of comparing memory buffers by using an alternative to for in which is significantly slower when compiler optimizations are disabled - such as most unit test scenarios. SR-6983

Benchmark

Related Issues:

@ThePragmaticArt
Copy link

ThePragmaticArt commented Mar 8, 2023

This seems to be a long time opened PR. We're in a bit of a situation right now where CI is executed on Intel, but local devices are Apple Silicon. The performance gain in this change is invaluable cost/time wise. Is there any reason this hasn't been merged in yet?

@stephencelis (maybe worth a chime in if there's a potential implementation issue)

@Kaspik
Copy link

Kaspik commented Mar 24, 2023

@jflan-dd @mbrandonw @stephencelis Guys, could we please get any attention on this repo and merge those extremely great and useful PRs? 🙏🏼

@jflan-dd
Copy link
Contributor

@Kaspik I wish I could help, but I'm not a maintainer on this repo. I wrote https://github.com/doordash-oss/swiftui-preview-snapshots which is a "plugin" for this repo, but it's purely a third party contribution.

@Kaspik
Copy link

Kaspik commented Oct 11, 2023

@stephencelis And this one please.

@jaanus
Copy link

jaanus commented Nov 24, 2023

Just a +1 from me. I‘ve been suffering from the slowness of the non-perceptual UIImage snapshot tests byte buffer comparison, and identified that it is exactly this loop causing the slowness. And I can confirm that the fix in this PR does work for me as expected, making the comparison massively faster. I may have to fork the repo and include this fix until this gets resolved.

Copy link
Member

@mbrandonw mbrandonw left a comment

Choose a reason for hiding this comment

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

Sorry for the late response, but this looks good to us. Will merge!

@mbrandonw
Copy link
Member

Actually going to close this and re-open a PR with some small fixes and re-based on top of main.

@mbrandonw
Copy link
Member

We just released this in 1.15.1.

@jaanus
Copy link

jaanus commented Nov 27, 2023

❤️ lovely, thank you.

@ejensen ejensen deleted the faster-buffer-iteration branch November 29, 2023 21:00
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.

Precision checking algorithm is very slow
10 participants