-
Notifications
You must be signed in to change notification settings - Fork 82
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
performance of md5_mb_over_4GB_test #67
Comments
Hi @KelvonLi, This example |
Hi @gbtucker , Thanks a lot for your reply.
My latest understanding is that, each ctx(lane) could only be used to calculate md5 at one moment and it should NOT be used until completed. Multiple ctxs(lanes) could run parallelly for each different md5 calculation. |
Hi @KelvonLi, For 1. all the functions are thread safe and reentrant. I would suggest one ctx per thread and take a look at the examples in examples/saturation_test for how to do this. For 2. the lanes must have independent hash jobs to run in parallel. Because these are cryptographic hashes, there is no way to break up one hash job and run pieces concurrently beyond the fundamental block size. |
Hi @gbtucker, |
Hi,
I'm trying md5_mb performance to figure out if it also perform much better than open ssl when running with many multiple buffers.
And I changed the test code as below and built it and had a test.
It turned out that the performance was worse than open ssl, on both of test CPU platforms.
Not sure if you had similar test, is it expected?
And how should I improve its performance?
Thanks a lot!
#Test result:
/workspace/isa-l_crypto/tests/extended # ./md5_mb_over_4GB_test
md5_large_test
md5_openssl: runtime = 22236247 usecs, bandwidth 8 MB in 22.2362 sec = 0.38 MB/s
Starting updates
md5_ctx_mgr: runtime = 52901056 usecs, bandwidth 8 MB in 52.9011 sec = 0.16 MB/s
# Test code change
/workspace/isa-l_crypto/tests/extended # git diff md5_mb_over_4GB_test.c
#include "md5_mb.h"
#include "endian_helper.h"
#include <openssl/md5.h>
+#include "test.h"
+
#define TEST_LEN (10241024ull) //1M
#define TEST_BUFS MD5_MIN_LANES
+//#define TEST_BUFS MD5_MAX_LANES
#define ROTATION_TIMES 10000 //total length processing = TEST_LEN * ROTATION_TIMES
#define UPDATE_SIZE (13MD5_BLOCK_SIZE)
#define LEN_TOTAL (TEST_LEN * ROTATION_TIMES)
@@ -54,6 +57,7 @@ int main(void)
uint32_t i, j, k, fail = 0;
unsigned char *bufs[TEST_BUFS];
struct user_data udata[TEST_BUFS];
struct perf start, stop;
posix_memalign((void *)&mgr, 16, sizeof(MD5_HASH_CTX_MGR));
md5_ctx_mgr_init(mgr);
@@ -72,11 +76,17 @@ int main(void)
}
//Openssl MD5 update test
perf_start(&start);
perf_stop(&stop);
printf("md5_openssl" ": ");
perf_print(stop, start, (long long)TEST_LEN * TEST_BUFS * 1);
// Initialize pool
for (i = 0; i < TEST_BUFS; i++) {
@@ -86,6 +96,7 @@ int main(void)
}
printf("Starting updates\n");
perf_start(&start);
int highest_pool_idx = 0;
ctx = &ctxpool[highest_pool_idx++];
while (ctx) {
@@ -117,6 +128,11 @@ int main(void)
ctx = md5_ctx_mgr_flush(mgr);
}
}
perf_stop(&stop);
printf("md5_ctx_mgr" ": ");
perf_print(stop, start, (long long)TEST_LEN * TEST_BUFS * 1);
lines 6-62/62 (END)
The text was updated successfully, but these errors were encountered: