summaryrefslogtreecommitdiff
path: root/modules/benchmark
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@hardinfo.org>2012-01-27 09:59:57 -0200
committerLeandro Pereira <leandro@hardinfo.org>2012-01-27 09:59:57 -0200
commitb2e6f23b7be1154227276f42c0fd59eaa1a07d52 (patch)
tree6e15dc531407d4f59be22a0814ebc39ff34542bc /modules/benchmark
parentcd7e7199a885327e4594e88b9b3fdddbb8fd2cee (diff)
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.
Diffstat (limited to 'modules/benchmark')
-rw-r--r--modules/benchmark/blowfish.c8
1 files changed, 2 insertions, 6 deletions
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;
}