Skip to content

use copy_within instead of manual logic #38

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

folkertdev
Copy link

Just a small readability win.

https://godbolt.org/z/9s3zMebrE

  • For memmove16, the assembly is basically equivalent for the happy path
  • For memcpy_within_slice the standard path that calls memmove has fewer instructions

In practice this logic is apparently not exercised enough to show any measurable effect


Btw I'm looking through your code base as a part of this rust project goal rust-lang/rust-project-goals#258. We've learned some things in zlib-rs that might be useful here too.

@CLAassistant
Copy link

CLAassistant commented May 9, 2025

CLA assistant check
All committers have signed the CLA.

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.

2 participants