Skip to content

Improve byte buffer iteration speed by 90%#664

Closed
ejensen wants to merge 1 commit into
pointfreeco:mainfrom
Frameio:faster-buffer-iteration
Closed

Improve byte buffer iteration speed by 90%#664
ejensen wants to merge 1 commit into
pointfreeco:mainfrom
Frameio:faster-buffer-iteration

Conversation

@ejensen

@ejensen ejensen commented Oct 22, 2022

Copy link
Copy Markdown
Contributor

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

ThePragmaticArt commented Mar 8, 2023

Copy link
Copy Markdown

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

Kaspik commented Mar 24, 2023

Copy link
Copy Markdown

@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
Copy Markdown
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

Kaspik commented Oct 11, 2023

Copy link
Copy Markdown

@stephencelis And this one please.

@jaanus

jaanus commented Nov 24, 2023

Copy link
Copy Markdown

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.

@mbrandonw mbrandonw left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Member

We just released this in 1.15.1.

@jaanus

jaanus commented Nov 27, 2023

Copy link
Copy Markdown

❤️ 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