diff options
author | Burt P <pburt0@gmail.com> | 2019-09-04 22:10:43 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2019-10-24 07:54:09 -0700 |
commit | c982d4e344f06a3b147d05de9476e7fcd7c9a5ac (patch) | |
tree | 46e64f891dd306a5a7e4f18b5b7ec8022651c244 /modules/benchmark/bench_results.c | |
parent | 9b17b17c56c62bfc1b72b74e5fa623f1ad47955e (diff) |
sysbench memory tweaks
* Use a larger sample size for sysbench 1.0+ and 64-bit
* Store pointer size with bench results
* Re-enable single thread memory benchmark
Use a larger sample size where available. The small size was
chosen because the 32-bit ARM sysbench 0.4x in raspbian
can't do more than about ~4G, but the problem is that much more
powerful machines burn through that very quickly. The result is
in MiB/s so it should still be comparable, but the results should
be more stable.
Noticed with Ryzen that multi-thread varies significantly based on
what threads are used, but benchmark doesn't really have control
over that.
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/benchmark/bench_results.c')
-rw-r--r-- | modules/benchmark/bench_results.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/modules/benchmark/bench_results.c b/modules/benchmark/bench_results.c index 04a0e879..2175953b 100644 --- a/modules/benchmark/bench_results.c +++ b/modules/benchmark/bench_results.c @@ -33,6 +33,7 @@ typedef struct { int cores; int threads; char *mid; + int ptr_bits; /* 32, 64... BENCH_PTR_BITS; 0 for unspecified */ int machine_data_version; } bench_machine; @@ -151,6 +152,7 @@ bench_machine *bench_machine_this() { m = bench_machine_new(); if (m) { + m->ptr_bits = BENCH_PTR_BITS; m->board = module_call_method("devices::getMotherboard"); m->cpu_name = module_call_method("devices::getProcessorName"); m->cpu_desc = module_call_method("devices::getProcessorDesc"); @@ -278,6 +280,8 @@ bench_result *bench_result_benchmarkconf(const char *section, const char *key, c b->machine->gpu_desc = strdup(values[11]); if (vl >= 13) b->machine->machine_data_version = atoi(values[12]); + if (vl >= 14) + b->machine->ptr_bits = atoi(values[13]); b->legacy = 0; } else if (vl >= 2) { b->bvalue.result = atof(values[0]); @@ -367,7 +371,7 @@ char *bench_result_benchmarkconf_line(bench_result *b) { char *bv = bench_value_to_str(b->bvalue); #define prep_str(s) (s ? (char*)auto_free(gg_key_file_parse_string_as_value(s, '|')) : "") - char *ret = g_strdup_printf("%s=%s|%d|%s|%s|%s|%s|%d|%d|%d|%d|%s|%s|%d\n", + char *ret = g_strdup_printf("%s=%s|%d|%s|%s|%s|%s|%d|%d|%d|%d|%s|%s|%d|%d\n", b->machine->mid, bv, b->bvalue.threads_used, prep_str(b->machine->board), prep_str(b->machine->cpu_name), @@ -377,7 +381,8 @@ char *bench_result_benchmarkconf_line(bench_result *b) { b->machine->processors, b->machine->cores, b->machine->threads, prep_str(b->machine->ogl_renderer), prep_str(b->machine->gpu_desc), - b->machine->machine_data_version // [12] + b->machine->machine_data_version, // [12] + b->machine->ptr_bits // [13] ); free(cpu_config); @@ -393,6 +398,9 @@ static char *bench_result_more_info_less(bench_result *b) { char bench_str[256] = ""; if (b->bvalue.revision >= 0) snprintf(bench_str, 127, "%d", b->bvalue.revision); + char bits[24] = ""; + if (b->machine->ptr_bits) + snprintf(bits, 23, _("%d-bit"), b->machine->ptr_bits); char *ret = g_strdup_printf("[%s]\n" /* threads */ "%s=%d\n" @@ -409,13 +417,14 @@ static char *bench_result_more_info_less(bench_result *b) { /* threads */ "%s=%d\n" /* gpu desc */ "%s=%s\n" /* ogl rend */ "%s=%s\n" - /* mem */ "%s=%s\n", + /* mem */ "%s=%s\n" + /* bits */ "%s=%s\n", _("Benchmark Result"), _("Threads"), b->bvalue.threads_used, _("Elapsed Time"), b->bvalue.elapsed_time, _("seconds"), - *bench_str ? _("Revision") : _("#Revision"), bench_str, - *b->bvalue.extra ? _("Extra Information") : _("#Extra"), b->bvalue.extra, - *b->bvalue.user_note ? _("User Note") : _("#User Note"), b->bvalue.user_note, + *bench_str ? _("Revision") : "#Revision", bench_str, + *b->bvalue.extra ? _("Extra Information") : "#Extra", b->bvalue.extra, + *b->bvalue.user_note ? _("User Note") : "#User Note", b->bvalue.user_note, b->legacy ? problem_marker() : "", 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.") : "", @@ -427,7 +436,8 @@ static char *bench_result_more_info_less(bench_result *b) { _("Threads Available"), b->machine->threads, _("GPU"), (b->machine->gpu_desc != NULL) ? b->machine->gpu_desc : _(unk), _("OpenGL Renderer"), (b->machine->ogl_renderer != NULL) ? b->machine->ogl_renderer : _(unk), - _("Memory"), memory + _("Memory"), memory, + b->machine->ptr_bits ? _("Pointer Size"): "#AddySize", bits ); free(memory); return ret; @@ -438,6 +448,9 @@ static char *bench_result_more_info_complete(bench_result *b) { strncpy(bench_str, b->name, 127); if (b->bvalue.revision >= 0) snprintf(bench_str + strlen(bench_str), 127, " (r%d)", b->bvalue.revision); + char bits[24] = ""; + if (b->machine->ptr_bits) + snprintf(bits, 23, _("%d-bit"), b->machine->ptr_bits); return g_strdup_printf("[%s]\n" /* bench name */"%s=%s\n" @@ -456,6 +469,7 @@ static char *bench_result_more_info_complete(bench_result *b) { /* gpu desc */ "%s=%s\n" /* ogl rend */ "%s=%s\n" /* mem */ "%s=%d %s\n" + /* bits */ "%s=%s\n" "%s=%d\n" "[%s]\n" /* mid */ "%s=%s\n" @@ -465,8 +479,8 @@ static char *bench_result_more_info_complete(bench_result *b) { _("Threads"), b->bvalue.threads_used, _("Result"), b->bvalue.result, _("Elapsed Time"), b->bvalue.elapsed_time, _("seconds"), - *b->bvalue.extra ? _("Extra Information") : _("#Extra"), b->bvalue.extra, - *b->bvalue.user_note ? _("User Note") : _("#User Note"), b->bvalue.user_note, + *b->bvalue.extra ? _("Extra Information") : "#Extra", b->bvalue.extra, + *b->bvalue.user_note ? _("User Note") : "#User Note", b->bvalue.user_note, b->legacy ? problem_marker() : "", 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.") : "", @@ -479,6 +493,7 @@ static char *bench_result_more_info_complete(bench_result *b) { _("GPU"), (b->machine->gpu_desc != NULL) ? b->machine->gpu_desc : _(unk), _("OpenGL Renderer"), (b->machine->ogl_renderer != NULL) ? b->machine->ogl_renderer : _(unk), _("Memory"), b->machine->memory_kiB, _("kiB"), + b->machine->ptr_bits ? _("Pointer Size"): "#AddySize", bits, ".machine_data_version", b->machine->machine_data_version, _("Handles"), _("mid"), b->machine->mid, |