From c38d62dba479a8a69703d0fb010ed34ac2ebc685 Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Sat, 20 Jan 2007 01:33:01 +0000 Subject: Better benchmark result handling when using synchronized data. --- hardinfo2/arch/common/blowfish.h | 9 ++------- hardinfo2/arch/common/fib.h | 6 +----- hardinfo2/arch/common/md5.h | 9 ++------- hardinfo2/arch/common/raytrace.h | 6 +----- hardinfo2/arch/common/sha1.h | 9 ++------- hardinfo2/arch/common/zlib.h | 16 ++++------------ 6 files changed, 12 insertions(+), 43 deletions(-) (limited to 'hardinfo2/arch') diff --git a/hardinfo2/arch/common/blowfish.h b/hardinfo2/arch/common/blowfish.h index 07160690..ceec7a96 100644 --- a/hardinfo2/arch/common/blowfish.h +++ b/hardinfo2/arch/common/blowfish.h @@ -18,7 +18,7 @@ #include -gchar * +static void benchmark_fish(void) { BLOWFISH_CTX ctx; @@ -39,8 +39,7 @@ benchmark_fish(void) bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL); if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); + return; } shell_view_set_enabled(FALSE); @@ -63,8 +62,4 @@ benchmark_fish(void) g_free(bdata_path); bench_results[BENCHMARK_BLOWFISH] = elapsed; - - gchar *retval = g_strdup_printf("[Results (in seconds; lower is better)]\n" - "This Machine=%.2f\n", elapsed); - return benchmark_include_results(retval, "CPU Blowfish"); } diff --git a/hardinfo2/arch/common/fib.h b/hardinfo2/arch/common/fib.h index e676e38e..645002fa 100644 --- a/hardinfo2/arch/common/fib.h +++ b/hardinfo2/arch/common/fib.h @@ -26,7 +26,7 @@ fib(gulong n) return fib(n - 1) + fib(n - 2); } -static gchar * +static void benchmark_fib(void) { GTimer *timer = g_timer_new(); @@ -45,8 +45,4 @@ benchmark_fib(void) g_timer_destroy(timer); bench_results[BENCHMARK_FIB] = elapsed; - - gchar *retval = g_strdup_printf("[Results]\n" - "This Machine=%.3f s\n", elapsed); - return benchmark_include_results(retval, "CPU Fibonacci"); } diff --git a/hardinfo2/arch/common/md5.h b/hardinfo2/arch/common/md5.h index 601eef94..95d683bd 100644 --- a/hardinfo2/arch/common/md5.h +++ b/hardinfo2/arch/common/md5.h @@ -18,7 +18,7 @@ #include -gchar * +static void benchmark_md5(void) { struct MD5Context ctx; @@ -36,8 +36,7 @@ benchmark_md5(void) bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL); if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); + return; } shell_view_set_enabled(FALSE); @@ -60,9 +59,5 @@ benchmark_md5(void) g_free(bdata_path); bench_results[BENCHMARK_MD5] = 312.0 / elapsed; - - gchar *retval = g_strdup_printf("[Results]\n" - "This Machine=%.2f MiB/s\n", 312.0 / elapsed); - return benchmark_include_results_reverse(retval, "CPU MD5"); } diff --git a/hardinfo2/arch/common/raytrace.h b/hardinfo2/arch/common/raytrace.h index d574779d..af9f2afa 100644 --- a/hardinfo2/arch/common/raytrace.h +++ b/hardinfo2/arch/common/raytrace.h @@ -18,7 +18,7 @@ void fbench(); /* fbench.c */ -static gchar * +static void benchmark_raytrace(void) { int i; @@ -42,9 +42,5 @@ benchmark_raytrace(void) g_timer_destroy(timer); bench_results[BENCHMARK_RAYTRACE] = elapsed; - - gchar *retval = g_strdup_printf("[Results (in seconds; lower is better)]\n" - "This Machine=%.2f\n", elapsed); - return benchmark_include_results(retval, "CPU Raytracing"); } diff --git a/hardinfo2/arch/common/sha1.h b/hardinfo2/arch/common/sha1.h index 79cfebcf..3b7f7652 100644 --- a/hardinfo2/arch/common/sha1.h +++ b/hardinfo2/arch/common/sha1.h @@ -17,7 +17,7 @@ */ #include -gchar * +static void benchmark_sha1(void) { SHA1_CTX ctx; @@ -35,8 +35,7 @@ benchmark_sha1(void) bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL); if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); + return; } shell_view_set_enabled(FALSE); @@ -59,9 +58,5 @@ benchmark_sha1(void) g_free(bdata_path); bench_results[BENCHMARK_SHA1] = 312.0 / elapsed; - - gchar *retval = g_strdup_printf("[Results]\n" - "This Machine=%.2f MiB/s\n", 312.0 / elapsed); - return benchmark_include_results_reverse(retval, "CPU SHA1"); } diff --git a/hardinfo2/arch/common/zlib.h b/hardinfo2/arch/common/zlib.h index 3a091ac0..96d20944 100644 --- a/hardinfo2/arch/common/zlib.h +++ b/hardinfo2/arch/common/zlib.h @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static gchar * +static void benchmark_zlib(void) { GModule *libz; @@ -30,8 +30,7 @@ benchmark_zlib(void) libz = g_module_open("/usr/lib/libz.so", G_MODULE_BIND_LAZY); if (!libz) { g_warning("Cannot load ZLib: %s", g_module_error()); - return g_strdup("[Error]\n" - "ZLib not found="); + return; } } @@ -39,8 +38,7 @@ benchmark_zlib(void) || !g_module_symbol(libz, "compressBound", (gpointer) & compressBound)) { g_module_close(libz); - return g_strdup("[Error]\n" - "Invalid Z-Lib found="); + return; } } @@ -56,8 +54,7 @@ benchmark_zlib(void) bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL); if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) { g_free(bdata_path); - return g_strdup("[Error]\n" - PREFIX "benchmark.data not found=\n"); + return; } shell_status_update("Compressing 64MB with default options..."); @@ -82,9 +79,4 @@ benchmark_zlib(void) g_free(bdata_path); bench_results[BENCHMARK_ZLIB] = 65536.0 / elapsed; - - gchar *retval = g_strdup_printf("[Results]\n" - "This Machine=%.3f KiB/s\n", - 65536.0 / elapsed); - return benchmark_include_results_reverse(retval, "CPU ZLib"); } -- cgit v1.2.3