diff options
author | Burt P <pburt0@gmail.com> | 2018-10-21 00:42:31 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2018-11-04 15:02:46 -0800 |
commit | d5d0607e4da1bde37fc0072c65689d2ed0775ed1 (patch) | |
tree | e0dfccc2a6e965870c9409e77e7bdfe4a8c5668a /modules/benchmark/blowfish.c | |
parent | f6299d9fad21c065d1e4c0f1093770835fb73adf (diff) |
benchmark/blowfish: new version of blowfish benchmark
The new version uses a fixed time and provides variants for
single-thread, multi-thread, and multi-core.
A few results are included.
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/benchmark/blowfish.c')
-rw-r--r-- | modules/benchmark/blowfish.c | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/modules/benchmark/blowfish.c b/modules/benchmark/blowfish.c index 2aa11a2a..f8d2e14a 100644 --- a/modules/benchmark/blowfish.c +++ b/modules/benchmark/blowfish.c @@ -491,48 +491,3 @@ void Blowfish_Init(BLOWFISH_CTX * ctx, unsigned char *key, int keyLen) } } } - -static gpointer -parallel_blowfish(unsigned int start, unsigned int end, void *data, gint thread_number) -{ - BLOWFISH_CTX ctx; - unsigned int i; - unsigned long L, R; - - L = 0xBEBACAFE; - R = 0xDEADBEEF; - - for (i = start; i <= end; i++) { - Blowfish_Init(&ctx, (unsigned char*)data, 65536); - Blowfish_Encrypt(&ctx, &L, &R); - Blowfish_Decrypt(&ctx, &L, &R); - } - - return NULL; -} - -void -benchmark_fish(void) -{ - bench_value r = EMPTY_BENCH_VALUE; - - gchar *tmpsrc; - gchar *bdata_path; - - bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL); - if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { - bench_results[BENCHMARK_BLOWFISH] = r; - g_free(bdata_path); - return; - } - - shell_view_set_enabled(FALSE); - shell_status_update("Performing Blowfish benchmark..."); - - r = benchmark_parallel_for(0, 0, 50000, parallel_blowfish, tmpsrc); - r.result = r.elapsed_time; - - bench_results[BENCHMARK_BLOWFISH] = r; - g_free(bdata_path); - g_free(tmpsrc); -} |