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

Use inline assembly for md5 #54

Closed
wants to merge 1 commit into from
Closed

Use inline assembly for md5 #54

wants to merge 1 commit into from

Conversation

johnmave126
Copy link

@johnmave126 johnmave126 commented Jan 16, 2023

This is a md5 implementation using inline assembly instead of relying on cc and .S. This has the benefit of compiling and running on MSVC targets.

Correctness

I have run a custom version of md-5 pointing to this branch with cargo +nightly test --features asm and cargo +nightly test --features asm --target i686-pc-windows-msvc on a windows machine and passed the test.

Performance

On my Linux machine, which has a Intel 6700K
Before:

test bench_compress ... bench:         104 ns/iter (+/- 0) = 9 MB/s

After:

test bench_compress ... bench:         103 ns/iter (+/- 0) = 9 MB/s

No observable performance degradation.

Drawback

This change needs a MSRV bump to 1.59.0 where inline assembly was stabilized.

@tarcieri
Copy link
Member

@johnmave126 with inline assembly I think you can just add it upstream to the md-5 crate

@johnmave126
Copy link
Author

@johnmave126 with inline assembly I think you can just add it upstream to the md-5 crate

That makes sense. Forgot to check #45

@tarcieri
Copy link
Member

Opened #55 to add info about that to the README

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