From b2e6f23b7be1154227276f42c0fd59eaa1a07d52 Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Fri, 27 Jan 2012 09:59:57 -0200 Subject: Fix weird results in benchmark values gcc was (correctly) assuming that benchmark_parallel_for() returned an integer, which was being to a double and messing up results. Added the missing prototype. Also, populate bench_results array with sane values on module init. Some other minor cleanups in benchmark code. --- modules/benchmark/blowfish.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'modules/benchmark') diff --git a/modules/benchmark/blowfish.c b/modules/benchmark/blowfish.c index b18b3570..feadc430 100644 --- a/modules/benchmark/blowfish.c +++ b/modules/benchmark/blowfish.c @@ -514,13 +514,12 @@ parallel_blowfish(unsigned int start, unsigned int end, void *data, gint thread_ void benchmark_fish(void) { - gdouble elapsed = 0; 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] = -1.0f; g_free(bdata_path); return; } @@ -528,10 +527,7 @@ benchmark_fish(void) shell_view_set_enabled(FALSE); shell_status_update("Performing Blowfish benchmark..."); - elapsed = benchmark_parallel_for(0, 50000, parallel_blowfish, tmpsrc); - + bench_results[BENCHMARK_BLOWFISH] = benchmark_parallel_for(0, 50000, parallel_blowfish, tmpsrc); g_free(bdata_path); g_free(tmpsrc); - - bench_results[BENCHMARK_BLOWFISH] = elapsed; } -- cgit v1.2.3