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

md5: Add inline-asm backend for LoongArch64 targets #505

Merged
merged 2 commits into from Sep 22, 2023
Merged

md5: Add inline-asm backend for LoongArch64 targets #505

merged 2 commits into from Sep 22, 2023

Conversation

heiher
Copy link
Contributor

@heiher heiher commented Sep 21, 2023

Tests

default features

$ cargo test

     Running tests/mod.rs (/home/hev/rust/hashes/target/debug/deps/mod-2ce358af9b31889b)

running 2 tests
test md5_main ... ok
test md5_rand ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s

   Doc-tests md5

running 1 test
test md5/src/lib.rs - (line 5) ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.41s

loongarch64_asm feature

$ cargo test -F loongarch64_asm
     Running tests/mod.rs (/home/hev/rust/hashes/target/debug/deps/mod-f553f45e9e6227ed)

running 2 tests
test md5_main ... ok
test md5_rand ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s

   Doc-tests md5

running 1 test
test md5/src/lib.rs - (line 5) ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.34s

Bench

Without this patch

test md5_10    ... bench:          33 ns/iter (+/- 0) = 303 MB/s
test md5_100   ... bench:         306 ns/iter (+/- 0) = 326 MB/s
test md5_1000  ... bench:       2,518 ns/iter (+/- 1) = 397 MB/s
test md5_10000 ... bench:      24,664 ns/iter (+/- 16) = 405 MB/s

With this patch

test md5_10    ... bench:          28 ns/iter (+/- 0) = 357 MB/s
test md5_100   ... bench:         250 ns/iter (+/- 0) = 400 MB/s
test md5_1000  ... bench:       2,121 ns/iter (+/- 0) = 471 MB/s
test md5_10000 ... bench:      20,835 ns/iter (+/- 2) = 479 MB/s

Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

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

Add CI job similar to one in the sha1 to test crate building.

md5/src/compress.rs Outdated Show resolved Hide resolved
md5/src/compress/loongarch64_asm.rs Outdated Show resolved Hide resolved
md5/src/compress/loongarch64_asm.rs Outdated Show resolved Hide resolved
@newpavlov
Copy link
Member

@heiher
Can you enable the "Allow edits by maintainers" checkbox? I would like to add minor tweaks before merging.

@heiher
Copy link
Contributor Author

heiher commented Sep 22, 2023

@heiher Can you enable the "Allow edits by maintainers" checkbox? I would like to add minor tweaks before merging.

I can't do it for existing pull request.

@heiher heiher closed this Sep 22, 2023
@newpavlov
Copy link
Member

I can do it in a separate PR then.

@newpavlov newpavlov reopened this Sep 22, 2023
@newpavlov newpavlov merged commit a24e8b7 into RustCrypto:master Sep 22, 2023
274 checks passed
@heiher heiher deleted the md5/loongarch64_asm branch September 22, 2023 13:02
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