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);
-
MD5_Init(&o_ctx);
for (k = 0; k < ROTATION_TIMES; k++) {
MD5_Update(&o_ctx, bufs[k % TEST_BUFS], TEST_LEN);
}
MD5_Final(digest_ref_upd, &o_ctx);
-
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);
printf("multibuffer md5 digest: \n");
for (i = 0; i < TEST_BUFS; i++) {
lines 6-62/62 (END)
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)