summaryrefslogtreecommitdiff
path: root/modules/benchmark
diff options
context:
space:
mode:
Diffstat (limited to 'modules/benchmark')
-rw-r--r--modules/benchmark/bench_results.c74
-rw-r--r--modules/benchmark/blowfish.c45
-rw-r--r--modules/benchmark/cryptohash.c33
-rw-r--r--modules/benchmark/drawing.c8
-rw-r--r--modules/benchmark/fft.c36
-rw-r--r--modules/benchmark/fib.c20
-rw-r--r--modules/benchmark/nqueens.c23
-rw-r--r--modules/benchmark/raytrace.c19
-rw-r--r--modules/benchmark/zlib.c26
9 files changed, 162 insertions, 122 deletions
diff --git a/modules/benchmark/bench_results.c b/modules/benchmark/bench_results.c
index 6c03250b..6c3f1c75 100644
--- a/modules/benchmark/bench_results.c
+++ b/modules/benchmark/bench_results.c
@@ -36,8 +36,7 @@ typedef struct {
typedef struct {
char *name;
- float result;
- int threads;
+ bench_value bvalue;
bench_machine *machine;
int legacy; /* an old benchmark.conf result */
} bench_result;
@@ -159,12 +158,6 @@ bench_machine *bench_machine_this() {
free(tmp);
cpu_procs_cores_threads(&m->processors, &m->cores, &m->threads);
- /*
- tmp = module_call_method("devices::getProcessorCount");
- m->threads = atoi(tmp);
- free(tmp);
- */
-
gen_machine_id(m);
}
return m;
@@ -187,7 +180,7 @@ void bench_result_free(bench_result *s) {
}
}
-bench_result *bench_result_this_machine(const char *bench_name, float result, int threads) {
+bench_result *bench_result_this_machine(const char *bench_name, bench_value r) {
bench_result *b = NULL;
b = malloc(sizeof(bench_result));
@@ -195,8 +188,7 @@ bench_result *bench_result_this_machine(const char *bench_name, float result, in
memset(b, 0, sizeof(bench_result));
b->machine = bench_machine_this();
b->name = strdup(bench_name);
- b->result = result;
- b->threads = threads;
+ b->bvalue = r;
b->legacy = 0;
}
return b;
@@ -221,6 +213,32 @@ static int nx_prefix(const char *str) {
return -1;
}
+/* old results didn't store the actual number of threads used */
+static int guess_threads_old_result(const char *bench_name, int threads_available) {
+#define CHKBNAME(BN) (strcmp(bench_name, BN) == 0)
+ if (CHKBNAME("CPU Fibonacci") )
+ return 1;
+ if (CHKBNAME("FPU FFT") ) {
+ if (threads_available >= 4)
+ return 4;
+ else if (threads_available >= 2)
+ return 2;
+ else
+ return 1;
+ }
+ if (CHKBNAME("CPU N-Queens") ) {
+ if (threads_available >= 10)
+ return 10;
+ else if (threads_available >= 5)
+ return 5;
+ else if (threads_available >= 2)
+ return 2;
+ else
+ return 1;
+ }
+ return threads_available;
+}
+
bench_result *bench_result_benchmarkconf(const char *section, const char *key, char **values) {
bench_result *b = NULL;
char *s0, *s1, *s2;
@@ -237,8 +255,8 @@ bench_result *bench_result_benchmarkconf(const char *section, const char *key, c
if (vl >= 10) { /* the 11th could be empty */
b->machine->mid = strdup(key);
- b->result = atof(values[0]);
- b->threads = atoi(values[1]);
+ b->bvalue.result = atof(values[0]);
+ b->bvalue.threads_used = atoi(values[1]);
b->machine->board = strdup(values[2]);
b->machine->cpu_name = strdup(values[3]);
b->machine->cpu_desc = strdup(values[4]);
@@ -251,7 +269,7 @@ bench_result *bench_result_benchmarkconf(const char *section, const char *key, c
b->machine->ogl_renderer = strdup(values[10]);
b->legacy = 0;
} else if (vl >= 2) {
- b->result = atof(values[0]);
+ b->bvalue.result = atof(values[0]);
b->legacy = 1;
/* old old format has prefix before cpu name (ex: 4x Pentium...) */
@@ -259,11 +277,9 @@ bench_result *bench_result_benchmarkconf(const char *section, const char *key, c
if (nx > 0) {
b->machine->cpu_name = strdup(strchr(key, 'x') + 1);
b->machine->threads = nx;
- b->threads = nx;
} else {
b->machine->cpu_name = strdup(key);
b->machine->threads = 1;
- b->threads = 1;
}
b->machine->cpu_config = strdup(values[1]);
@@ -271,9 +287,10 @@ bench_result *bench_result_benchmarkconf(const char *section, const char *key, c
nx = nx_prefix(values[1]);
if (nx > 0) {
b->machine->threads = nx;
- b->threads = nx;
}
+ b->bvalue.threads_used = guess_threads_old_result(section, b->machine->threads);
+
/* If the clock rate in the id string is more than the
* config string, use that. Older hardinfo used current cpu freq
* instead of max freq.
@@ -295,7 +312,7 @@ bench_result *bench_result_benchmarkconf(const char *section, const char *key, c
n = atof(s1+1);
n *= m;
- s1 = g_strdup_printf("%dx %.2f %s", b->threads, n, _("MHz"));
+ s1 = g_strdup_printf("%dx %.2f %s", b->bvalue.threads_used, n, _("MHz"));
if ( cpu_config_cmp(b->machine->cpu_config, s1) == -1
&& !cpu_config_is_close(b->machine->cpu_config, s1) ) {
free(b->machine->cpu_config);
@@ -328,7 +345,7 @@ bench_result *bench_result_benchmarkconf(const char *section, const char *key, c
char *bench_result_benchmarkconf_line(bench_result *b) {
char *cpu_config = cpu_config_retranslate(b->machine->cpu_config, 1, 0);
char *ret = g_strdup_printf("%s=%.2f|%d|%s|%s|%s|%s|%d|%d|%d|%d|%s\n",
- b->machine->mid, b->result, b->threads,
+ b->machine->mid, b->bvalue.result, b->bvalue.threads_used,
(b->machine->board != NULL) ? b->machine->board : "",
b->machine->cpu_name,
(b->machine->cpu_desc != NULL) ? b->machine->cpu_desc : "",
@@ -341,7 +358,7 @@ char *bench_result_benchmarkconf_line(bench_result *b) {
return ret;
}
-char *bench_result_more_info(bench_result *b) {
+static char *bench_result_more_info_less(bench_result *b) {
char *memory =
(b->machine->memory_kiB > 0)
? g_strdup_printf("%d %s", b->machine->memory_kiB, _("kiB") )
@@ -359,7 +376,7 @@ char *bench_result_more_info(bench_result *b) {
/* ogl rend */ "%s=%s\n"
/* mem */ "%s=%s\n",
_("Benchmark Result"),
- _("Threads"), b->threads,
+ _("Threads"), b->bvalue.threads_used,
b->legacy ? _("Note") : "#Note",
b->legacy ? _("This result is from an old version of HardInfo. Results might not be comparable to current version. Some details are missing.") : "",
_("Machine"),
@@ -375,11 +392,12 @@ char *bench_result_more_info(bench_result *b) {
return ret;
}
-char *bench_result_more_info_complete(bench_result *b) {
+static char *bench_result_more_info_complete(bench_result *b) {
return g_strdup_printf("[%s]\n"
/* bench name */"%s=%s\n"
- /* result */ "%s=%0.2f\n"
/* threads */ "%s=%d\n"
+ /* result */ "%s=%0.2f\n"
+ /* elapsed */ "%s=%0.2f\n"
/* legacy */ "%s=%s\n"
"[%s]\n"
/* board */ "%s=%s\n"
@@ -394,8 +412,9 @@ char *bench_result_more_info_complete(bench_result *b) {
/* cfg_val */ "%s=%.2f\n",
_("Benchmark Result"),
_("Benchmark"), b->name,
- _("Result"), b->result,
- _("Threads"), b->threads,
+ _("Threads"), b->bvalue.threads_used,
+ _("Result"), b->bvalue.result,
+ _("Elapsed Time"), b->bvalue.elapsed_time,
b->legacy ? _("Note") : "#Note",
b->legacy ? _("This result is from an old version of HardInfo. Results might not be comparable to current version. Some details are missing.") : "",
_("Machine"),
@@ -411,3 +430,8 @@ char *bench_result_more_info_complete(bench_result *b) {
_("cfg_val"), cpu_config_val(b->machine->cpu_config)
);
}
+
+char *bench_result_more_info(bench_result *b) {
+ //return bench_result_more_info_complete(b);
+ return bench_result_more_info_less(b);
+}
diff --git a/modules/benchmark/blowfish.c b/modules/benchmark/blowfish.c
index feadc430..2aa11a2a 100644
--- a/modules/benchmark/blowfish.c
+++ b/modules/benchmark/blowfish.c
@@ -15,8 +15,8 @@ You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
+
+
COMMENTS ON USING THIS CODE:
@@ -31,7 +31,7 @@ Normal usage is as follows:
[4] Decryption is the same as encryption except that the plaintext and
ciphertext are reversed.
-Warning #1: The code does not check key lengths. (Caveat encryptor.)
+Warning #1: The code does not check key lengths. (Caveat encryptor.)
Warning #2: Beware that Blowfish keys repeat such that "ab" = "abab".
Warning #3: It is normally a good idea to zeroize the BLOWFISH_CTX before
freeing it.
@@ -41,33 +41,33 @@ Warning #4: Endianness conversions are the responsibility of the caller.
Warning #5: Make sure to use a reasonable mode of operation for your
application. (If you don't know what CBC mode is, see Warning #7.)
Warning #6: This code is susceptible to timing attacks.
-Warning #7: Security engineering is risky and non-intuitive. Have someone
+Warning #7: Security engineering is risky and non-intuitive. Have someone
check your work. If you don't know what you are doing, get help.
This is code is fast enough for most applications, but is not optimized for
speed.
-If you require this code under a license other than LGPL, please ask. (I
-can be located using your favorite search engine.) Unfortunately, I do not
-have time to provide unpaid support for everyone who uses this code.
+If you require this code under a license other than LGPL, please ask. (I
+can be located using your favorite search engine.) Unfortunately, I do not
+have time to provide unpaid support for everyone who uses this code.
-- Paul Kocher
-*/
-
+*/
+
#include "hardinfo.h"
#include "benchmark.h"
#include "blowfish.h"
-
+
#define N 16
static const unsigned long ORIG_P[16 + 2] =
{ 0x243F6A88L, 0x85A308D3L, 0x13198A2EL, 0x03707344L, 0xA4093822L,
0x299F31D0L, 0x082EFA98L, 0xEC4E6C89L, 0x452821E6L, 0x38D01377L,
0xBE5466CFL, 0x34E90C6CL, 0xC0AC29B7L,
- 0xC97C50DDL, 0x3F84D5B5L, 0xB5470917L, 0x9216D5D9L, 0x8979FB1BL
+ 0xC97C50DDL, 0x3F84D5B5L, 0xB5470917L, 0x9216D5D9L, 0x8979FB1BL
};
-static const unsigned long ORIG_S[4][256] = {
+static const unsigned long ORIG_S[4][256] = {
{0xD1310BA6L, 0x98DFB5ACL, 0x2FFD72DBL, 0xD01ADFB7L, 0xB8E1AFEDL,
0x6A267E96L, 0xBA7C9045L, 0xF12C7F99L, 0x24A19947L, 0xB3916CF7L,
0x0801F2E2L, 0x858EFC16L, 0x636920D8L, 0x71574E69L, 0xA458FEA3L,
@@ -383,7 +383,7 @@ static const unsigned long ORIG_S[4][256] = {
0x85CBFE4EL, 0x8AE88DD8L, 0x7AAAF9B0L, 0x4CF9AA7EL, 0x1948C25CL,
0x02FB8A8CL, 0x01C36AE4L, 0xD6EBE1F9L, 0x90D4F869L, 0xA65CDEA0L,
0x3F09252DL, 0xC208E69FL, 0xB74E6132L, 0xCE77E25BL, 0x578FDFE3L,
- 0x3AC372E6L}
+ 0x3AC372E6L}
};
static unsigned long F(BLOWFISH_CTX * ctx, unsigned long x)
@@ -440,14 +440,14 @@ void Blowfish_Decrypt(BLOWFISH_CTX * ctx, unsigned long *xl,
for (i = N + 1; i > 1; --i) {
Xl = Xl ^ ctx->P[i];
Xr = F(ctx, Xl) ^ Xr;
-
- /* Exchange Xl and Xr */
+
+ /* Exchange Xl and Xr */
temp = Xl;
Xl = Xr;
Xr = temp;
}
-
- /* Exchange Xl and Xr */
+
+ /* Exchange Xl and Xr */
temp = Xl;
Xl = Xr;
Xr = temp;
@@ -502,7 +502,7 @@ parallel_blowfish(unsigned int start, unsigned int end, void *data, gint thread_
L = 0xBEBACAFE;
R = 0xDEADBEEF;
- for (i = start; i <= end; i++) {
+ for (i = start; i <= end; i++) {
Blowfish_Init(&ctx, (unsigned char*)data, 65536);
Blowfish_Encrypt(&ctx, &L, &R);
Blowfish_Decrypt(&ctx, &L, &R);
@@ -514,12 +514,14 @@ parallel_blowfish(unsigned int start, unsigned int end, void *data, gint thread_
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] = -1.0f;
+ bench_results[BENCHMARK_BLOWFISH] = r;
g_free(bdata_path);
return;
}
@@ -527,7 +529,10 @@ benchmark_fish(void)
shell_view_set_enabled(FALSE);
shell_status_update("Performing Blowfish benchmark...");
- bench_results[BENCHMARK_BLOWFISH] = benchmark_parallel_for(0, 50000, parallel_blowfish, tmpsrc);
+ 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);
}
diff --git a/modules/benchmark/cryptohash.c b/modules/benchmark/cryptohash.c
index d97e85c7..6150f3ef 100644
--- a/modules/benchmark/cryptohash.c
+++ b/modules/benchmark/cryptohash.c
@@ -20,21 +20,21 @@
#include "sha1.h"
#include "benchmark.h"
-static void inline md5_step(char *data, glong srclen)
+void inline md5_step(char *data, glong srclen)
{
struct MD5Context ctx;
guchar checksum[16];
-
+
MD5Init(&ctx);
MD5Update(&ctx, (guchar *)data, srclen);
MD5Final(checksum, &ctx);
}
-static void inline sha1_step(char *data, glong srclen)
+void inline sha1_step(char *data, glong srclen)
{
SHA1_CTX ctx;
guchar checksum[20];
-
+
SHA1Init(&ctx);
SHA1Update(&ctx, (guchar*)data, srclen);
SHA1Final(checksum, &ctx);
@@ -43,37 +43,38 @@ static void inline sha1_step(char *data, glong srclen)
static gpointer cryptohash_for(unsigned int start, unsigned int end, void *data, gint thread_number)
{
unsigned int i;
-
- for (i = start; i <= end; i++) {
+
+ for (i = start; i <= end; i++) {
if (i & 1) {
md5_step(data, 65536);
} else {
sha1_step(data, 65536);
}
}
-
+
return NULL;
}
void
benchmark_cryptohash(void)
{
- gdouble elapsed = 0;
+ bench_value r = EMPTY_BENCH_VALUE;
gchar *tmpsrc, *bdata_path;
-
+
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;
- }
-
+ }
+
shell_view_set_enabled(FALSE);
shell_status_update("Running CryptoHash benchmark...");
-
- elapsed = benchmark_parallel_for(0, 5000, cryptohash_for, tmpsrc);
-
+
+ r = benchmark_parallel_for(0, 0, 5000, cryptohash_for, tmpsrc);
+
g_free(bdata_path);
g_free(tmpsrc);
-
- bench_results[BENCHMARK_CRYPTOHASH] = 312.0 / elapsed;
+
+ r.result = 312.0 / r.elapsed_time; //TODO: explain in code comments
+ bench_results[BENCHMARK_CRYPTOHASH] = r;
}
diff --git a/modules/benchmark/drawing.c b/modules/benchmark/drawing.c
index 67a2c264..d0905954 100644
--- a/modules/benchmark/drawing.c
+++ b/modules/benchmark/drawing.c
@@ -22,8 +22,12 @@
void
benchmark_gui(void)
{
+ bench_value r = EMPTY_BENCH_VALUE;
+
shell_view_set_enabled(FALSE);
shell_status_update("Running drawing benchmark...");
-
- bench_results[BENCHMARK_GUI] = guibench();
+
+ r.result = guibench(); //TODO: explain in code comments
+
+ bench_results[BENCHMARK_GUI] = r;
}
diff --git a/modules/benchmark/fft.c b/modules/benchmark/fft.c
index 7c5889c8..caa52d3d 100644
--- a/modules/benchmark/fft.c
+++ b/modules/benchmark/fft.c
@@ -25,43 +25,43 @@ static gpointer fft_for(unsigned int start, unsigned int end, void *data, gint t
unsigned int i;
FFTBench **benches = (FFTBench **)data;
FFTBench *fftbench = (FFTBench *)(benches[thread_number]);
-
- for (i = start; i <= end; i++) {
+
+ for (i = start; i <= end; i++) {
fft_bench_run(fftbench);
}
-
+
return NULL;
}
+#define FFT_MAXT 4
+
void
benchmark_fft(void)
{
- gdouble elapsed = 0;
+ bench_value r = EMPTY_BENCH_VALUE;
+
int n_cores, i;
gchar *temp;
FFTBench **benches;
-
+
shell_view_set_enabled(FALSE);
shell_status_update("Running FFT benchmark...");
-
+
/* Pre-allocate all benchmarks */
- temp = module_call_method("devices::getProcessorCount");
- n_cores = temp ? atoi(temp) : 1;
- g_free(temp);
-
- benches = g_new0(FFTBench *, n_cores);
- for (i = 0; i < n_cores; i++) {
+ benches = g_new0(FFTBench *, FFT_MAXT);
+ for (i = 0; i < FFT_MAXT; i++) {
benches[i] = fft_bench_new();
}
-
+
/* Run the benchmark */
- elapsed = benchmark_parallel_for(0, 4, fft_for, benches);
-
+ r = benchmark_parallel_for(FFT_MAXT, 0, FFT_MAXT, fft_for, benches);
+
/* Free up the memory */
- for (i = 0; i < n_cores; i++) {
+ for (i = 0; i < FFT_MAXT; i++) {
fft_bench_free(benches[i]);
}
g_free(benches);
-
- bench_results[BENCHMARK_FFT] = elapsed;
+
+ r.result = r.elapsed_time;
+ bench_results[BENCHMARK_FFT] = r;
}
diff --git a/modules/benchmark/fib.c b/modules/benchmark/fib.c
index 0f88be59..d75ac367 100644
--- a/modules/benchmark/fib.c
+++ b/modules/benchmark/fib.c
@@ -18,8 +18,7 @@
#include "benchmark.h"
-static gulong
-fib(gulong n)
+gulong fib(gulong n)
{
if (n == 0)
return 0;
@@ -32,19 +31,22 @@ void
benchmark_fib(void)
{
GTimer *timer = g_timer_new();
- gdouble elapsed;
-
+ bench_value r = EMPTY_BENCH_VALUE;
+
shell_view_set_enabled(FALSE);
shell_status_update("Calculating the 42nd Fibonacci number...");
-
+
g_timer_reset(timer);
g_timer_start(timer);
fib(42);
-
+
g_timer_stop(timer);
- elapsed = g_timer_elapsed(timer, NULL);
+ r.elapsed_time = g_timer_elapsed(timer, NULL);
g_timer_destroy(timer);
-
- bench_results[BENCHMARK_FIB] = elapsed;
+
+ r.threads_used = 1;
+ r.result = r.elapsed_time;
+
+ bench_results[BENCHMARK_FIB] = r;
}
diff --git a/modules/benchmark/nqueens.c b/modules/benchmark/nqueens.c
index a32ed8c1..78293abb 100644
--- a/modules/benchmark/nqueens.c
+++ b/modules/benchmark/nqueens.c
@@ -25,7 +25,7 @@ bool safe(int x, int y)
int nqueens(int y)
{
int x;
-
+
for (x = 0; x < QUEENS; x++) {
if (safe((row[y - 1] = x), y - 1)) {
if (y < QUEENS) {
@@ -35,32 +35,33 @@ int nqueens(int y)
}
}
}
-
+
return 0;
}
static gpointer nqueens_for(unsigned int start, unsigned int end, void *data, gint thread_number)
{
unsigned int i;
-
- for (i = start; i <= end; i++) {
+
+ for (i = start; i <= end; i++) {
nqueens(0);
}
-
+
return NULL;
}
void
benchmark_nqueens(void)
{
- gdouble elapsed = 0;
-
+ bench_value r = EMPTY_BENCH_VALUE;
+
shell_view_set_enabled(FALSE);
shell_status_update("Running N-Queens benchmark...");
-
- elapsed = benchmark_parallel_for(0, 10, nqueens_for, NULL);
-
- bench_results[BENCHMARK_NQUEENS] = elapsed;
+
+ r = benchmark_parallel_for(0, 0, 10, nqueens_for, NULL);
+ r.result = r.elapsed_time;
+
+ bench_results[BENCHMARK_NQUEENS] = r;
}
diff --git a/modules/benchmark/raytrace.c b/modules/benchmark/raytrace.c
index 2ee36a93..c7963583 100644
--- a/modules/benchmark/raytrace.c
+++ b/modules/benchmark/raytrace.c
@@ -24,24 +24,25 @@ static gpointer
parallel_raytrace(unsigned int start, unsigned int end, gpointer data, gint thread_number)
{
unsigned int i;
-
- for (i = start; i <= end; i++) {
+
+ for (i = start; i <= end; i++) {
fbench();
}
-
+
return NULL;
}
void
benchmark_raytrace(void)
{
- gdouble elapsed = 0;
-
+ bench_value r = EMPTY_BENCH_VALUE;
+
shell_view_set_enabled(FALSE);
shell_status_update("Performing John Walker's FBENCH...");
-
- elapsed = benchmark_parallel_for(0, 1000, parallel_raytrace, NULL);
-
- bench_results[BENCHMARK_RAYTRACE] = elapsed;
+
+ r = benchmark_parallel_for(0, 0, 1000, parallel_raytrace, NULL);
+ r.result = r.elapsed_time;
+
+ bench_results[BENCHMARK_RAYTRACE] = r;
}
diff --git a/modules/benchmark/zlib.c b/modules/benchmark/zlib.c
index eeec9d0e..2ded59a4 100644
--- a/modules/benchmark/zlib.c
+++ b/modules/benchmark/zlib.c
@@ -31,8 +31,8 @@ static gpointer zlib_for(unsigned int start, unsigned int end, void *data, gint
compressed = malloc(bound);
if (!compressed)
return NULL;
-
- for (i = start; i <= end; i++) {
+
+ for (i = start; i <= end; i++) {
char uncompressed[65536];
uLong compressedBound = bound;
uLong destBound = sizeof(uncompressed);
@@ -42,30 +42,32 @@ static gpointer zlib_for(unsigned int start, unsigned int end, void *data, gint
}
free(compressed);
-
+
return NULL;
}
void
benchmark_zlib(void)
{
- gdouble elapsed = 0;
+ bench_value r = EMPTY_BENCH_VALUE;
gchar *tmpsrc, *bdata_path;
-
+
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;
- }
-
+ }
+
shell_view_set_enabled(FALSE);
shell_status_update("Running Zlib benchmark...");
-
- elapsed = benchmark_parallel_for(0, 50000, zlib_for, tmpsrc);
-
+
+ r = benchmark_parallel_for(0, 0, 50000, zlib_for, tmpsrc);
+
g_free(bdata_path);
g_free(tmpsrc);
- gdouble marks = (50000. * 65536.) / (elapsed * 840205128.);
- bench_results[BENCHMARK_ZLIB] = marks;
+ //TODO: explain in code comments
+ gdouble marks = (50000. * 65536.) / (r.elapsed_time * 840205128.);
+ r.result = marks;
+ bench_results[BENCHMARK_ZLIB] = r;
}