intel / intel/isa-l_crypto

performance of md5_mb_over_4GB_test

Open
#67 4 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C
Stars
301
Forks
91
PR merge metrics
No merged PRs in 30d

Description

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
+#include "test.h"
+
#define TEST_LEN (1024*1024ull) //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 (13*MD5_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)

Contributor guide

Open the contributing guide

Research direction

Start with tests/extended/md5_mb_over_4GB_test.c and review the modified timing around the OpenSSL MD5_Update loop and the md5_ctx_mgr update loop. Reproduce the reported benchmark on the available CPU platforms, verify that both paths process equivalent data, and compare the resulting measurements to determine whether the performance difference is expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.