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

md4: Optimize compress to improve hash performance by about 12.5% #519

Merged
merged 2 commits into from
Nov 18, 2023

Conversation

CausingBrick
Copy link
Contributor

Test

running 2 tests
test md4_main ... ok
test md4_rand ... ok

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

Bench

Without this patch

running 4 tests
test md4_10    ... bench:           9 ns/iter (+/- 0) = 1111 MB/s
test md4_100   ... bench:          85 ns/iter (+/- 0) = 1176 MB/s
test md4_1000  ... bench:         855 ns/iter (+/- 3) = 1169 MB/s
test md4_10000 ... bench:       8,564 ns/iter (+/- 15) = 1167 MB/s

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

With this patch

running 4 tests
test md4_10    ... bench:           8 ns/iter (+/- 0) = 1250 MB/s
test md4_100   ... bench:          83 ns/iter (+/- 0) = 1204 MB/s
test md4_1000  ... bench:         833 ns/iter (+/- 8) = 1200 MB/s
test md4_10000 ... bench:       8,344 ns/iter (+/- 112) = 1198 MB/s

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

@newpavlov
Copy link
Member

Thank you! On my PC performance improvement is much smaller (~2.5%), but still measurable.

@newpavlov newpavlov merged commit 9f66cb8 into RustCrypto:master Nov 18, 2023
11 checks passed
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